Skip to content

Conversation

@mapodaca-nv
Copy link

Implement ByteAddressBuffer AlignedLoad and AlignedStore proposal:
https://github.com/microsoft/hlsl-specs/blob/main/proposals/0051-byte-address-buffer-alignment.md

This PR only contains the changes necessary to implement the reduced version proposed by this PR:
microsoft/hlsl-specs#731

Included extensive positive and negative tests.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

switch (opCode) {
case hlsl::IntrinsicOp::MOP_AlignedLoad:
case hlsl::IntrinsicOp::MOP_AlignedStore:
// AlignedLoad/AlignedStore require SM 6.2+ (DXIL 1.2+) for
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably okay, but I do just want to call out that drivers have never been tested seeing an alignment value here that doesn't match the size of the data being loaded, as far as I know. There was a while where WARP used the alignment value to determine the data size instead of looking at the LLVM type (I don't know why...). If we do a spot check of modern drivers across the ecosystem and they seem okay with larger alignment values, I'm fine keeping this as a retro-enablement for SM6.2, but we should do the due diligence before lighting this up for customers.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood. As this was still WIP, I was mostly demonstrating that this feature could be retroactively allowed on SM6.2+. The final determination is TBD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

2 participants