DirectXShaderCompiler
DirectXShaderCompiler copied to clipboard
[SPIR-V] Why is the `vk::BufferPointer` itself getting loaded with `Align 4` ?
Description
I was putting a vk::BufferPointer in a Push Constant struct.
Steps to Reproduce
https://godbolt.org/z/9eMrbqe3W
Actual Behavior
In the SPIR-V the pointer itself (not the value it points to) gets OpLoaded with extra Aligned 4 operands.
There are a few things wrong with this:
- AFAIK only PhysicalStorageBuffer storage class pointers can be used for
OpLoad/OpStorewhich has an extraAlignedoperand, the access chain from which it gets loaded is inOpTypePointer PushConstant - Even if the above were legal, the
Aligned 4is wrong because the alignment of a BDA is 8
Given (1) I'm surprised SPIR-V Validator hasn't screamed about this.
Environment
- DXC version
- Host Operating System
@danbrown-amd
Looks like @danbrown-amd is working on this.