You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Disable 16bit Store with RWByteAddressBuffer for SPIRV - #8426
As we represent RWByteAddressBuffers in SPIRV as an array of uints we have no correct way to represent a 16bit store to the buffer. Currently we load a uint, mask values from it, write in our new 16 bits, then write to the buffer. This works for single threaded cases but if multiple threads are accessing adjacent shorts in the uint data is clobbered.
This patch catches the write in Sema and errors instead of going on to produce invalid code.
The clobbering behaviour can be seen in this test.
Alexander Johnston (@Alexander-Johnston) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
(default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
(when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
This looks like a user-visible bug fix/feature change. Please add (or point to) the corresponding entry in docs/ReleaseNotes.md.
If release-note coverage is planned in a related PR (including one that hasn’t been submitted yet), please mention that plan/link so we can avoid duplicate notes.
As we represent RWByteAddressBuffers in SPIRV as an array of uints we have no
correct way to represent a 16bit store to the buffer. Currently we load a uint,
mask values from it, write in our new 16 bits, then write to the buffer. This
works for single threaded cases but if multiple threads are accessing adjacent
shorts in the uint data is clobbered.
This patch catches the write in Sema and in the SPIRV emitter, and errors instead
of going on to produce invalid code with race conditions.
This is a non-ideal solution, but for RWByteAddressBuffers to support 16 bit
stores we require SPIRV Untyped Pointers which are not yet widely available.
The best we can do for now is to error on HLSL code which would generate the
invalid code.
The affected tests were testing the tight packing of 16 bit values in
RWByteAddressBuffers in SPIRV, ensuring that they matched the DX layout.
The load test is still legal and useful, but as the store tests are
testing something we are banning, they have been removed.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
SPIR-V and DXIL regression validation remains unverified for the new semantic restriction and backend error path.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Use one sentence for the release-note description
docs/ReleaseNotes.md:91
Minor: CONTRIBUTING.md:138 requires release-note descriptions to be a single sentence, but this entry uses two. Combine the restriction and its diagnostic into one sentence.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As we represent RWByteAddressBuffers in SPIRV as an array of uints we have no correct way to represent a 16bit store to the buffer. Currently we load a uint, mask values from it, write in our new 16 bits, then write to the buffer. This works for single threaded cases but if multiple threads are accessing adjacent shorts in the uint data is clobbered.
This patch catches the write in Sema and errors instead of going on to produce invalid code.
The clobbering behaviour can be seen in this test.