Are Discard and Return not allowed in the same function as a textureSample? #3695
Unanswered
jonathandw743
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Rejecting the first example is correct, textureSample needs to be called from uniform control flow. The gradient from adjacent pixels is needed for the mip-level and filtering. Putting the textureSample in a function should still be an error, but I think naga doesn't fully implement uniformity analysis yet: https://github.com/gfx-rs/naga/issues/1744 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The following code produces the error:
But when I wrap the textureSample in its own function (as in the following code), the error stops showing and the shader works as intended.
Is this intended behaviour?
And if so may I ask why?
Beta Was this translation helpful? Give feedback.
All reactions