DirectXShaderCompiler icon indicating copy to clipboard operation
DirectXShaderCompiler copied to clipboard

Silent crash or validation error when SV_InnerCoverage semantic is assigned to a float parameter instead of uint

Open Dredhog opened this issue 4 years ago • 5 comments

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

  1. 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.

Dredhog avatar Jun 08 '20 13:06 Dredhog

DXIL issue is not fixed.

pow2clk avatar Sep 14 '20 21:09 pow2clk

uh, sorry I didn't realize this.

ehsannas avatar Sep 15 '20 02:09 ehsannas

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.

pow2clk avatar Sep 15 '20 02:09 pow2clk

Reopened because fix was reverted https://godbolt.org/z/x4z7Gonbc

pow2clk avatar Sep 26 '23 15:09 pow2clk

Seeing some weird discrepancies between godbolt and my local windows install. Linux vs windows maybe. Godbolt gives a validation error, windows crashes locally.

pow2clk avatar Sep 26 '23 15:09 pow2clk

No plans to address this in DXC. We'll ensure that this isn't an issue in clang.

damyanp avatar Jun 27 '24 17:06 damyanp