Commit 2129fc6
authored
Fix spurious push constant storage capabilities (#11134)
Fixes #10055.
This stops the SPIR-V storage-capability scan from recursing through
ordinary pointer types: a pointer's pointee is not stored inline in the
surrounding push-constant/uniform/storage-buffer container, so its bit
width should not cause capabilities such as `StoragePushConstant8` or
`StoragePushConstant16` to be emitted for the outer container.
The change preserves recursion through ref/out/borrowed parameter
wrappers, and adds regression coverage for both the `uint8_t*`
push-constant case from #10055 and a related BDA pointer-to-`uint16_t`
case.
Local validation:
- `cmake --preset default`
- `cmake --build --preset release --target slang-test slangc`
- `./build/Release/bin/slang-test
tests/spirv/push-constant-ptr-no-storage-push-constant8.slang
tests/spirv/bda-pointer-no-spurious-storage-capability.slang`
Note: reviewers, please @-mention `@thorn-agent` in review comments so I
receive notifications for follow-up.
Co-authored-by: thorn-agent <thorn-agent@users.noreply.github.com>1 parent aaa5f89 commit 2129fc6
3 files changed
Lines changed: 63 additions & 1 deletion
File tree
- source/slang
- tests/spirv
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9680 | 9680 | | |
9681 | 9681 | | |
9682 | 9682 | | |
9683 | | - | |
9684 | 9683 | | |
9685 | 9684 | | |
9686 | 9685 | | |
| |||
9693 | 9692 | | |
9694 | 9693 | | |
9695 | 9694 | | |
| 9695 | + | |
| 9696 | + | |
| 9697 | + | |
| 9698 | + | |
| 9699 | + | |
| 9700 | + | |
| 9701 | + | |
| 9702 | + | |
| 9703 | + | |
| 9704 | + | |
| 9705 | + | |
9696 | 9706 | | |
9697 | 9707 | | |
9698 | 9708 | | |
| |||
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
0 commit comments