HLSL: way to treat discard as OpDemoteToHelperInvocation without requiring SPIR-V 1.6/Vulkan 1.3 #3297
Labels
goal:client support
Feature or fix needed for a current slang user.
priority:medium
nice to have in next milestone
Milestone
In DXC, there is an option to treat discard as OpDemoteToHelperInvocation
-fspv-extension=SPV_EXT_demote_to_helper_invocation
. This is needed because OpKill can lead to undefined behavior in derivatives following the kill if it's executed outside of uniform flow control (OpKill is basically broken and has been deprecated). Could we get an option like-fspv-extension=SPV_EXT_demote_to_helper_invocation
so that that even for example for SPIR-V 1.3 we use the extension, i.e.:Also, I noticed that DXC treats
clip(x)
as OpKill even under this option. I'm not sure if that's a bug with DXC, but it seems like probably clip and discard should be treated the same?Some background: microsoft/DirectXShaderCompiler#2823
The text was updated successfully, but these errors were encountered: