[SPIRV] Use scalar rules for BDA alignment - #8576
Conversation
Previously the `vk::RawBufferLoad` and `vk::RawBufferStore` instructions used a default alignment of 4 unless the user explicitly specified a different value. This change instead makes the default be based on the minimum legal value for the type being loaded so that users don't need to explicitly override it when loading arbitrary data types. Fixes microsoft#8572 Assisted by Claude Opus 4.8
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
|
|
Diego Novillo (@dnovillo) or Gregory Roth (@pow2clk), can one of you give this a review? |
There was a problem hiding this comment.
Pull request overview
Updates SPIR-V raw buffer operations to infer legal default alignment from the accessed type.
Changes:
- Computes scalar-layout alignment for raw loads and stores.
- Adds coverage for scalar and composite types.
- Updates existing tests and release notes.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
SpirvEmitter.cpp |
Computes default buffer alignment. |
intrinsics.vkrawbufferload.64bit-align.hlsl |
Tests inferred alignments. |
intrinsics.vkrawbufferload.hlsl |
Updates 16-bit intrinsic expectations. |
ReleaseNotes.md |
Documents the fix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| - SPIR-V fixed incorrect alignment of 64-bit elements in `vk::RawBufferLoad` and | ||
| `vk::RawBufferStore` intrinsics | ||
| [#8576](https://github.com/microsoft/DirectXShaderCompiler/pull/8576) |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (1)
docs/ReleaseNotes.md:47
CONTRIBUTING.md:136-140requires release-note entries to be a single sentence and says not to link specific PRs. Please link the fixed issue (#8572) instead and terminate the sentence; theSPIR-V:prefix also matches the surrounding entries.
- SPIR-V fixed incorrect alignment of 64-bit elements in `vk::RawBufferLoad` and
`vk::RawBufferStore` intrinsics
[#8576](https://github.com/microsoft/DirectXShaderCompiler/pull/8576)
Diego Novillo (dnovillo)
left a comment
There was a problem hiding this comment.
Just one nit. Everything looks good for SPIR-V. Thanks.
| [#6464](https://github.com/microsoft/DirectXShaderCompiler/issues/6464). | ||
| - SPIR-V fixed incorrect alignment of 64-bit elements in `vk::RawBufferLoad` and | ||
| `vk::RawBufferStore` intrinsics | ||
| [#8576](https://github.com/microsoft/DirectXShaderCompiler/pull/8576) |
Previously the
vk::RawBufferLoadandvk::RawBufferStoreinstructions used a default alignment of 4 unless the user explicitly specified a different value. This change instead makes the default be based on the minimum legal value for the type being loaded so that users don't need to explicitly override it when loading arbitrary data types.Fixes #8572
Assisted by Claude Opus 4.8