Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPIR-V] Compiler throws an exception on mesh shader compilation when one entry point calls another. #7009

Open
neversleeping opened this issue Nov 14, 2024 · 0 comments
Labels
bug Bug, regression, crash needs-triage Awaiting triage spirv Work related to SPIR-V

Comments

@neversleeping
Copy link

neversleeping commented Nov 14, 2024

Description

When trying to compile a mesh shader, where 2 entry points exist and one of them is called inside another, dxcompiler.dll throws an exception. Specifically, exception is happening when function which have indices parameter modifier is called.

Steps to Reproduce
Compile this code with arguments -E MSMain -T ms_6_5 -spirv. This will result in exception. If you will delete indices from MSMainCalled declaration, compilation will succeed.

struct MeshOutput {
    float4 position: SV_Position;
    float3 color: COLOR0;
};

[outputtopology("triangle")]
[numthreads(1, 1, 1)]
void MSMainCalled(out indices uint3 triangles[1], out vertices MeshOutput verts[3]) {
    SetMeshOutputCounts(3, 1);
    triangles[0] = uint3(0, 1, 2);

    verts[0].position = float4(-0.5, 0.5, 0.0, 1.0);
    verts[0].color = float3(1.0, 0.0, 0.0);

    verts[1].position = float4(0.5, 0.5, 0.0, 1.0);
    verts[1].color = float3(0.0, 1.0, 0.0);

    verts[2].position = float4(0.0, -0.5, 0.0, 1.0);
    verts[2].color = float3(0.0, 0.0, 1.0);
}

[outputtopology("triangle")]
[numthreads(1, 1, 1)]
void MSMain(out indices uint3 triangles[1], out vertices MeshOutput verts[3]) {
	MSMainCalled(triangles, verts);
}

https://godbolt.org/z/1Tboc87rd

Actual Behavior
Exception thrown at 0x00007FFDC9B7D034 (dxcompiler.dll) in Application.exe: 0xC0000005: Access violation reading location 0x000000000000005C.

Environment

  • DXC version: 1.8 - 1.8.0.4666 (release-1.8.2407, 8df0a9d)
  • Host Operating System: Windows 11 23H2
@neversleeping neversleeping added bug Bug, regression, crash needs-triage Awaiting triage spirv Work related to SPIR-V labels Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug, regression, crash needs-triage Awaiting triage spirv Work related to SPIR-V
Projects
Status: No status
Development

No branches or pull requests

1 participant