Perform sampling before branching to discard
This two fragment shaders that exhibit undefined behavior. In GLSL, it is undefined to use implicit or explicit derivatives in non-uniform control flow [1]. The SPIR-V produced by glslang contained similar undefined behavior, which results in incorrect codegen with the amdvlk's LLPC shader compiler, and produces visually incorrect image. This PR fixes this issue by hoisting the sampling so that it's executed before discarding. It's a simple fix and may not be the optimial way to resolve this issue. [1] https://www.khronos.org/registry/OpenGL/specs/gl/GLSLangSpec.4.60.pdf p. 137.
This commit is contained in:
parent
3977935d94
commit
8982f8f2ec
4 changed files with 11 additions and 3 deletions
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue