KhronosGroup / KhronosGroup/SPIRV-Tools
spirv-val "Assertion failed" when an AccelerationStructure handle is put inside a uniform buffer
- Dominant language
- C++
- Stars
- 1.4k
- Forks
- 709
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 28
Description
I've been working on adding support for ray tracing to [my shader EDSL](https://gitlab.com/sheaf/fir) which compiles directly to `SPIR-V`.
I assumed that one was allowed to store an `AccelerationStructure` handle in structures, and that it would behave like a 64-bit unsigned integer. I presume that's actually not permitted (could someone point to the relevant part of the `SPIR-V` specification? I must have missed it). At any rate, it triggers the following assertion failure:
> Assertion failed: 0, file ..\source\val\validate_decorations.cpp, line 225
I believe `spirv-val` should throw an error in this case rather than an assertion failed.
Contributor guide
Research direction
Start in source/val/validate_decorations.cpp at line 225 and inspect the validation path reached when an AccelerationStructure handle is placed in a uniform-buffer structure. Reproduce the reported spirv-val failure using the SPIR-V generated by the linked shader EDSL, then verify that invalid input produces a validation diagnostic instead of an assertion failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100