Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
devshgraphicsprogramming opened this issue Oct 14, 2024 · 1 comment
Labels
bug Bug, regression, crash needs-triage Awaiting triage spirv Work related to SPIR-V

Comments

@devshgraphicsprogramming

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
@devshgraphicsprogramming devshgraphicsprogramming added bug Bug, regression, crash needs-triage Awaiting triage spirv Work related to SPIR-V labels Oct 14, 2024
@s-perron s-perron moved this to For Google in HLSL Triage Oct 15, 2024
@s-perron
Copy link
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.

@s-perron s-perron added this to the Next+1 Release milestone Oct 28, 2024
@s-perron s-perron moved this from For Google to Triaged in HLSL Triage Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug, regression, crash needs-triage Awaiting triage spirv Work related to SPIR-V
Projects
Status: New
Status: Triaged
Development

No branches or pull requests

2 participants