Skip to content

[SPIR-V] vk::SpirvType used as T in vk::RawBuffer APIs causes SIGSEGV #6963

Closed

Description

Description
Tried to use a sized inline SpirvType for uint8_t with RawBuffer because I couldn't use my own bda::__ref (inline Spir-V PhysicalStorageBuffer class pointer to type T) because of #6951 not being merged yet fixing the Spir-V Type of Spir-V Type issue.

Steps to Reproduce

Godbolt DXC trunk: https://godbolt.org/z/61WsMPzjr

Actual Behavior

Crash with SIGSEGV

My own godbolt instance (a few commits behind) has a Debug build of DXC and I can't see any assert being hit.

Environment

  • DXC version: latest
  • Host Operating System: whatever you have an Godbolt

Activity

  1. added
    bug
    needs-triage
    spirv
    on Oct 14, 2024
  2. s-perron commented on Oct 28, 2024

    @s-perron
    Collaborator

    We are hitting an assert:

    assert(recordType->isStructureType());

    The issues is that the vk::SpirvType is a record type, but not a structured type. The type is:

    RecordType 0x555555a57630 'vk::SpirvType<21, 1, 1, vk::Literal<vk::integral_constant<unsigned int, 8> >, vk::Literal<vk::integral_constant<unsigned int, 0> > >'
    `-ClassTemplateSpecialization 0x555555a574e0 'SpirvType'
    

    We need to add special handling for the types in the vulkan name space. An easy solution to fix just this issue is to assume that the type is not an array or struct type that requires layout information. However that will not work for all cases. Some more investigation should be done to check how layout rules can be handled.

  3. moved this from For Google to Triaged in HLSL Triageon Oct 28, 2024
  4. added a commit that references this issue on May 13, 2025
    cb893e4
  5. moved this from New to In review in HLSL Roadmapon May 13, 2025
  6. moved this from In review to Done in HLSL Roadmapon May 15, 2025
  7. added a commit that references this issue on May 19, 2025
    2a6bacd
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