Skip to content

HLSL: Invalid output with trailing top level block #2653

Description

@kurrycat2004

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions