Description
The spirv generator fails to generate code when using a struct with a namespaced member.
Steps to Reproduce
Command line:
dxc /nologo /Od /Zi -spirv -fspv-flatten-resource-arrays -Efail -Tvs_6_0 -Fo fail.spv fail.hlsl
Code:
struct L { float2 p0, p1; };
namespace R {
struct PU {
float4x4 p;
};
}
struct VU {
float4 c;
};
struct U {
R::PU b;
VU v;
};
static inline L failme(U u) {
L o;
o.p0 = float2(0, 0);
o.p1 = float2(0, 1);
return o;
}
[[ vk::binding(0, 0) ]] ConstantBuffer<U> us : register(b0, space0);
struct O {
float4 p : SV_POSITION;
};
O fail() {
// crash
L pl = failme(us);
O o;
o.p = float4(0,0,0,1);
return o;
}
Actual Behavior
fails to compile with error
Trying to generate a type that we cannot generate
Removing the namespace by adding using namespace R; is a possible workaround.
Environment
- DXC version (libdxcompiler.dylib: 1.10(5304-0131a626)(1.9.0.15304))
- Host Operating System osx 26.4
Description
The spirv generator fails to generate code when using a struct with a namespaced member.
Steps to Reproduce
Command line:
Code:
Actual Behavior
fails to compile with error
Trying to generate a type that we cannot generateRemoving the namespace by adding
using namespace R;is a possible workaround.Environment