Skip to content

spirv: replace discard with demote for incorrect HLSL->SPIR-V translations

Rhys Perry requested to merge pendingchaos/mesa:spirv_discard_to_demote into master

glslang (with HLSL source) and DirectXShaderCompiler usually use an incorrect discard implementation.

It does seem that DirectXShaderCompiler creates correct code if -fspv-extension=SPV_EXT_demote_to_helper_invocation is used, so the workaround is disabled if that capability is used: https://github.com/microsoft/DirectXShaderCompiler/blob/master/tools/clang/test/CodeGenSPIRV/cf.discard.hlsl

Edited by Rhys Perry

Merge request reports