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 (b106a96); dxil.dll: 1.9(1.8.2505.32)
- Windows 11 25H2