In this example: https://godbolt.org/z/nfbxzT1Es you can see the trailing static type_ConstantBuffer_Data _58; at the top.
I only noticed this because of the output of DXC changing after an update, causing this to trigger.
Only happens when debug info is enabled.
DXC 1.8.2505 for example on compiler explorer compiles SPIRV which is correctly transformed back into HLSL.
Not sure if a simple if (type_is_top_level_block(type)) continue; in the TypeUndef branch of CompilerHLSL::emit_specialization_constants_and_structs would be enough to fix this, but at least thats how its done in CompilerGLSL::emit_resources.
In this example: https://godbolt.org/z/nfbxzT1Es you can see the trailing
static type_ConstantBuffer_Data _58;at the top.I only noticed this because of the output of DXC changing after an update, causing this to trigger.
Only happens when debug info is enabled.
DXC
1.8.2505for example on compiler explorer compiles SPIRV which is correctly transformed back into HLSL.Not sure if a simple
if (type_is_top_level_block(type)) continue;in theTypeUndefbranch ofCompilerHLSL::emit_specialization_constants_and_structswould be enough to fix this, but at least thats how its done inCompilerGLSL::emit_resources.