microsoft / microsoft/DirectXShaderCompiler
[SPIR-V] -fspv-preserve-interface fails to work if -fspv-flatten-resource-arrays is also specified
Open
@Keenuts is already working on this.
Since Dec 10, 2025.
bug
needs-triage
spirv
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
Description
dxc running on a simple shader that has one unused field in the input struct drops this field, when it should preserve it since -fspv-preserve-interface was passed.
Steps to Reproduce
dxc -E main -T ps_6_0 -spirv -fspv-flatten-resource-arrays -fspv-preserve-interface minimal.hlsl
minimal.hlsl
struct Input
{
float2 f_uv : TEXCOORD0;
float3 f_normal_world : TEXCOORD1;
};
float4 main(Input i) : SV_Target0
{
return float4(i.f_normal_world, 1.0f);
}
Actual Behavior
After looking at the generated SPIR-V file with spirv-dis, you can see that f_uv is not present:
// this will be the only input variable, no TEXCOORD0
OpName %in_var_TEXCOORD1 "in.var.TEXCOORD1"
Environment
- dxcompiler.dll: 1.9 - 1.8.2505.32 (b106a961d); dxil.dll: 1.9(1.8.2505.32)
- Windows 11 25H2
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.
Assessment
This issue has not been assessed yet.