microsoft / microsoft/DirectXShaderCompiler
Internal compiler error on shader validation
Open
Nobody has claimed this yet.
bug
crash
incorrect-code
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
Reproduces on latest release.
struct gl_PerVertex {
float4 gl_Position : SV_Position;
float gl_PointSize : PSIZE;
float gl_ClipDistance[1] : SV_ClipDistance;
float gl_CullDistance[1] : SV_CullDistance;
};
struct type10 {
float2 member : LOC0;
float4 gl_Position1 : SV_Position;
float gl_PointSize1 : PSIZE;
float gl_ClipDistance1[1] : SV_ClipDistance;
float gl_CullDistance1[1] : SV_CullDistance;
};
static float2 v_uv;
static float2 a_uv;
static gl_PerVertex perVertexStruct;
static float2 a_pos;
struct VertexInput {
float2 a_uv2 : LOC1;
float2 a_pos2 : LOC0;
};
void main()
{
float2 _expr12 = a_uv;
v_uv = _expr12;
float2 _expr13 = a_pos;
perVertexStruct.gl_Position = float4(_expr13.x, _expr13.y, 0.0, 1.0);
return;
}
type10 vert_main(VertexInput vertexinput)
{
a_uv = vertexinput.a_uv2;
a_pos = vertexinput.a_pos2;
main();
float2 _expr10 = v_uv;
float4 _expr11 = perVertexStruct.gl_Position;
float _expr12 = perVertexStruct.gl_PointSize;
float _expr13[] = perVertexStruct.gl_ClipDistance;
float _expr14[] = perVertexStruct.gl_CullDistance;
const type10 type10_ = { _expr10, _expr11, _expr12, _expr13, _expr14 };
return type10_;
}
./dxc.exe ./shader.hlsl -T vs_5_0 -E vert_main -Wno-parentheses-equality -Zi -Qembed_debug
Internal compiler error: access violation. Attempted to read from address 0x0000000000000009
The shader is not valid, generated by work in progress hlsl-out backend in naga, but dxc should be able to parse it without any ICE.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running dxc.exe with the supplied shader.hlsl command to reproduce the access violation on the reported release. Trace the validation path for this shader until the internal compiler error is identified, then verify that the same input reports a normal diagnostic or completes without an ICE.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100