-
Notifications
You must be signed in to change notification settings - Fork 827
[SPIR-V] Add .CalculateLevelOfDetailUnclamped() and .Gather() methods for vk::SampledTexture2D type.
#8070
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@s-perron |
s-perron
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. Nothing too different than what I said on the first PR.
| 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); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It became much better, thanks!
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
Part of #7979
Implement methods for
vk::SampledTexture2D: