microsoft / microsoft/DirectXShaderCompiler
[SPIR-V] Integer bitfield is emitted into seperate storage slot, breaking array stride
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
Description
Similar to issue #8470, adding an int type bitfield mixed in with uint bitfields causes separate member slots to be emitted, changing the ArrayStride.
Steps to Reproduce
Repro with int bitfield member, ArrayStride is incorrectly 24: https://godbolt.org/z/da48esceE
With uint member instead, ArrayStride is 20 as intended: https://godbolt.org/z/MTq8xanx3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the two Godbolt reproductions in the issue and compare the generated SPIR-V for mixed int and uint bitfields. Trace the SPIR-V bitfield layout and member-slot handling to find why the int member changes ArrayStride. Done means mixed bitfields use the intended stride of 20, with a regression test covering the case.
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
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100