Skip to content

[SPIR-V] Push constant of a derived struct causes multiple fatal errors #8247

Open

Description

Description
(1) Attempting to access a value in a push constant of a derived struct results in fatal error: generated SPIR-V is invalid: OpAccessChain reached non-composite type while indexes still remain to be traversed.

(2) A different fatal error is produced if the derived push constant struct is empty whereas the parent has members: fatal error: generated SPIR-V is invalid: Index '9[%int_0]' is out of bounds: OpAccessChain cannot find index 0 into the structure <id> '4[%type_PushConstant_SDebugPushConstants]'. This structure has 0 members. Largest valid index is -1.

Steps to Reproduce
(1) Use a push constant of a derived struct type and attempt to access members of the struct. See godbolt repro: https://godbolt.org/z/fqKvr6581

(2) Use a push constant of a derived struct type (of which has no members of its own) and attempt to access members of the parent struct type. See godbolt repro: https://godbolt.org/z/q4x4KWd43

Actual Behavior
Would expect both cases to work perfectly fine. Current workaround is having to do composition over inheritance. https://godbolt.org/z/KjvaYedvq

Environment

  • DXC version trunk
  • Host Operating System Windows 11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugspirv

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions