Repository navigation
Conversation
RDNA ISA §8 ignores the two LSBs of the immediate offset and of soffset separately before they are summed. Adding first then shifting made soffset=3 offset:3 load dword 1 instead of dword 0.
Owner
Author
|
Opened against the fork by mistake; upstream PR is Marvisak#2438 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
s_buffer_load_dword*on RDNA adds the immediate offset andsoffsetafter clearing each term's two LSBs (RDNA ISA guide §8, Scalar Memory Operations). Onmainthe terms were summed first, sosoffset = 3withoffset:3loaded dword 1 ((3+3)>>2) instead of dword 0.Tracked as VIC-BT-025 in Marvisak#1249. Related open head Marvisak#1939 (
triage: needs work) — this is a focused slice with the citation and distinguishingsoffset=3, offset:3case from that triage.Change
In
crates/victory-shader/src/emit/lower.rs, mask only the instruction operands (imm & !3,soffset & !3) before adding. Descriptorbase/ dynamicextrastay unmasked.Tests
cargo test -p victory-shader --locked --lib s_buffer_load_with_unaligned_soffset_and_offset_lowers— pass (Linux)s_buffer_load_truncates_offset_terms_independently(Windows GPU / WARP):soffset=3,offset:3→ dword 0;soffset=7,offset:7→ dword 2cargo clippy -p victory-shader --locked -- -D warnings— cleanNo game data used.