[SPIR-V] Add .CalculateLevelOfDetailUnclamped() and .Gather() methods for vk::SampledTexture2D type.#8070
Open
luciechoi wants to merge 14 commits intomicrosoft:mainfrom
Open
[SPIR-V] Add .CalculateLevelOfDetailUnclamped() and .Gather() methods for vk::SampledTexture2D type.#8070luciechoi wants to merge 14 commits intomicrosoft:mainfrom
.CalculateLevelOfDetailUnclamped() and .Gather() methods for vk::SampledTexture2D type.#8070luciechoi wants to merge 14 commits intomicrosoft:mainfrom
Conversation
Collaborator
Author
|
@s-perron |
s-perron
reviewed
Jan 18, 2026
Collaborator
s-perron
left a comment
There was a problem hiding this comment.
This looks good. Nothing too different than what I said on the first PR.
Comment on lines
5857
to
5881
| if (isSample) { | ||
| if (numArgs > 2) { | ||
| clamp = doExpr(expr->getArg(2)); | ||
| } | ||
| if (numArgs > 3) { | ||
| status = doExpr(expr->getArg(3)); | ||
| } | ||
| return createImageSample( | ||
| retType, imageType, sampledImage, /*sampler*/ nullptr, coordinate, | ||
| /*compareVal*/ nullptr, /*bias*/ nullptr, | ||
| /*lod*/ nullptr, {nullptr, nullptr}, constOffset, varOffset, | ||
| /*constOffsets*/ nullptr, /*sample*/ nullptr, | ||
| /*minLod*/ clamp, status, loc, range); | ||
| } else { | ||
| if (numArgs > 2) { | ||
| status = doExpr(expr->getArg(2)); | ||
| } | ||
| return spvBuilder.createImageGather( | ||
| retType, imageType, sampledImage, /*sampler*/ nullptr, coordinate, | ||
| // .Gather() doc says we return four components of red data. | ||
| spvBuilder.getConstantInt(astContext.IntTy, llvm::APInt(32, 0)), | ||
| /*compareVal*/ nullptr, constOffset, varOffset, | ||
| /*constOffsets*/ nullptr, /*sampleNumber*/ nullptr, status, loc, | ||
| range); | ||
| } |
Collaborator
There was a problem hiding this comment.
See my comment in the other PR. As I mentioned there, you will eventually recreate all of the logic for the non-sampled image case.
Collaborator
Author
There was a problem hiding this comment.
It became much better, thanks!
Contributor
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
s-perron
approved these changes
Feb 11, 2026
Collaborator
|
LGTM but presubmits are still failing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #7979
Implement methods for
vk::SampledTexture2D: