DirectXShaderCompiler
DirectXShaderCompiler copied to clipboard
Silent crash or validation error when SV_InnerCoverage semantic is assigned to a float parameter instead of uint
Title
Silent crash or validation error (DXIL and SPIR-V backends respectively) when SV_InnerCoverage semantic is assigned to a float parameter instead of uint
Functional impact
Compiler crashes, no result gets printed to stdout for the DXIL backend. SPIR-V backend prints validation error and asks to report a bug.
Minimal repro steps
- Compile repro_shader.txt with
dxc.exe -E frag -T ps_6_1 repro_shader.txt
float4 frag (uint viewID : SV_ViewID, float innerCoverage : SV_InnerCoverage) : SV_Target
{
return float4(1, float(viewID), innerCoverage, 0);
}
Expected result
The compiler prints out an informative error message.
Actual result
Compiler crashes, no result gets printed to stdout for the DXIL backend.
Further technical details
Running the snippet through the SPIR-V backend with dxc.exe -E frag -T ps_6_1 repro_shader.txt -spirv
produces the following validation error:
fatal error: generated SPIR-V is invalid: Expected Constituents to be scalars or vectors of the same type as Result Type components %23 = OpCompositeConstruct %v4float %float_1 %22 %21 %float_0 note: please file a bug report on https://github.com/Microsoft/DirectXShaderCompiler/issues with source code if possible
DXC bult from changeset 5ebc67c618d7061407cca039573108078f601ee6.
DXIL issue is not fixed.
uh, sorry I didn't realize this.
No problem, we were just doing bug triage and I thought I'd make sure since this wasn't an issue I'd looked at much before.
Reopened because fix was reverted https://godbolt.org/z/x4z7Gonbc
Seeing some weird discrepancies between godbolt and my local windows install. Linux vs windows maybe. Godbolt gives a validation error, windows crashes locally.
No plans to address this in DXC. We'll ensure that this isn't an issue in clang.