You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In HLSL, the discard keyword is specified to demote the invocation rather than terminating it, meaning that quad ops or derivatives remain well defined after a discard.
However, in GLSL, discard (or terminateInvocation) both cause the invocation to stop executing, resulting in undefined values or undefined behavior for subsequent quad or derivative operations if the entire quad (or primitive in some cases) was not discarded/terminated.
Detecting non uniformity conditions is beyond the scope of what glsl can provide currently, so an outright error isn't plausible as things currently stand, but it might be useful to emit a warning to at least give developers a heads up that this will happen. Actual validation errors will have to be handled via GPU AV in the Vulkan validation layers.
So I'd like to suggest we add a warning to glslang if there is a discard or terminateInvocation call, followed by any subgroupQuad* or implicit derivative texturing operation later in the shader in any fragment shader.
The text was updated successfully, but these errors were encountered:
In HLSL, the
discard
keyword is specified to demote the invocation rather than terminating it, meaning that quad ops or derivatives remain well defined after a discard.However, in GLSL,
discard
(orterminateInvocation
) both cause the invocation to stop executing, resulting in undefined values or undefined behavior for subsequent quad or derivative operations if the entire quad (or primitive in some cases) was not discarded/terminated.Detecting non uniformity conditions is beyond the scope of what glsl can provide currently, so an outright error isn't plausible as things currently stand, but it might be useful to emit a warning to at least give developers a heads up that this will happen. Actual validation errors will have to be handled via GPU AV in the Vulkan validation layers.
So I'd like to suggest we add a warning to glslang if there is a
discard
orterminateInvocation
call, followed by any subgroupQuad* or implicit derivative texturing operation later in the shader in any fragment shader.The text was updated successfully, but these errors were encountered: