Skip to content

Internal compiler error when targeting spirv #4640

Description

@avennstrom

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug, regression, crashspirvWork related to SPIR-V

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Triaged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions