Skip to content

[SPIR-V] generated SPIR-V is invalid: Result type (OpTypeStruct) does not match the type that results from indexing into the composite (OpTypeStruct). #8244

@alexandreLBarrett

Description

@alexandreLBarrett

Description
While trying to compile my shader for SPIR-V I get an error regarding two OpTypeStruct that don't match. I get it when trying to assigning a ConstantBuffer to a T in the shader. See Godbolt link for more details.

Steps to Reproduce
See Godbolt link: https://godbolt.org/z/vT9jzazfr

It seems related to the fact there is a nested struct inside another struct used in a ConstantBuffer. They are then incompatible.

Actual Behavior

fatal error: generated SPIR-V is invalid: Result type (OpTypeStruct) does not match the type that results from indexing into the composite (OpTypeStruct).
  %33 = OpCompositeExtract %DirectionalLight_0 %32 0

Environment

  • DXC version 1.8.2505 (Godbolt link), also on 1.9.2602
  • Host Operating System: Windows 11 25H2

Metadata

Metadata

Assignees

Labels

bugBug, regression, crashspirvWork related to SPIR-V

Type

No type

Projects

Status

Triaged

Relationships

None yet

Development

No branches or pull requests

Issue actions