microsoft / microsoft/DirectXShaderCompiler
Dynamic resources validation errors: All metadata must be used by dxil.!55 = !{i32 1}
Open
Nobody has claimed this yet.
bug
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
Compiling this code with -T ps_6_6 -E PSMain outputs: error: All metadata must be used by dxil.!55 = !{i32 1}
Is this code invalid or is it a compiler bug in DXC?
https://godbolt.org/z/4fMjoW4Gv
struct PSInput
{
float4 position : SV_Position;
float4 color : COLOR0;
};
cbuffer Ids {
int id1;
int id2;
};
static const Texture2D<float4> textures[2] = {
Texture2D<float4>(ResourceDescriptorHeap[id1]),
Texture2D<float4>(ResourceDescriptorHeap[id2])
};
SamplerState ss: register(s0);
float4 PSMain(PSInput input) : SV_Target0
{
float4 sample = textures[NonUniformResourceIndex(int(input.color.x))].Sample(ss, float2(0, 1));
return sample;
}
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
Reproduce the report using the linked Godbolt example and the -T ps_6_6 -E PSMain command. Inspect the handling of dynamic resources and the emitted dxil.!55 metadata around the “All metadata must be used” diagnostic. Done means determining whether the HLSL is valid and, if so, correcting the validation failure with coverage for this case.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100