microsoft / microsoft/DirectXShaderCompiler

[SPIR-V] Integer bitfield is emitted into seperate storage slot, breaking array stride

Open
#8,857 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-triage spirv
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.