Sometimes when targeting SPIRV the compiler crashes instead of outputing warnings.
The following shader contains an error, a float is passed to a inout float3 argument.
RWTexture2D<float> g_output;
void foo(inout float3 x)
{
x += float3(1, 2, 3);
}
[numthreads(1, 1, 1)]
void main(uint3 id : SV_DispatchThreadId)
{
float bar = 1;
foo(bar);
g_output[id.xy] = bar;
}
Compiling to DXIL produces the expected error:
> dxc.exe -E main -Fo out.bin -T cs_6_0 shader.hlsl
shader.hlsl:3:23: warning: implicit truncation of vector type [-Wconversion]
void foo(inout float3 x)
^
Targeting SPIRV crashes the compiler:
> dxc.exe -spirv -E main -Fo out.bin -T cs_6_0 shader.hlsl
Internal compiler error: access violation. Attempted to read from address 0x0000000000000028
Tested on version:
> dxc.exe --version
dxcompiler.dll: 1.7 - 1.6.0.3576 (9395376ef)
Sometimes when targeting SPIRV the compiler crashes instead of outputing warnings.
The following shader contains an error, a
floatis passed to ainout float3argument.Compiling to DXIL produces the expected error:
Targeting SPIRV crashes the compiler:
Tested on version: