tombox-xshader: count ds_read/ds_write b96 and b128 at their full size in ds_reach (follow-up to #257) #380
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/380"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from omonkeyz/xbox-emulator. Originally posted by SchmashinPrunes on 2026-11-25T14:42:48Z.
@omonkeyz, this is a follow-up to #257. It fixes the
ds_reachsizing I flagged in my #257 review. It does not close the gap from your follow-up comment, sub-version 5 containers whose ISA starts before 0x130. More on that below.The fix
ds_reachinhlsl/lds64.rsgaveds_read_b96,ds_read_b128,ds_write_b96andds_write_b128a 4-byte element, because none of those names contains64,_b8or_b16. Their real sizes are 12 and 16 bytes. Two places useds_reach:lds64_dwordsrefuses a shader with a 64-bit LDS atomic when a static LDS offset reaches past the declared LDS size. A 128-bit access was undercounted by 12 bytes, so for exampleds_read_b128at offset 0x1ff4 passed in a shader that declares 8 KiB.static_reach, which decides which header dwords "fit" a shader, was short by the same amount for shaders whose highest access is a 96- or 128-bit one.Now 96- and 128-bit accesses count at their full size. The other forms are unchanged.
The short-header sub-version 5 containers
I can't help with this part from here. Proving a location needs real console containers, and I don't have any. Your fixture test already prints the offsets that fit each fixture, per sub-version. For the 7 that fail, that list should show whether one location fits all of them, or whether the dword sits at a fixed distance before the ISA (the case
scan_recovers_a_planted_dword_and_tells_a_fixed_offset_from_one_counted_back_from_the_isachecks for). The fixture test uses the correctedds_reach, so rerun it on this branch.Tests
ds_reach_counts_the_whole_access:ds_read/ds_writeb32, b64, b96 and b128 at offset 0x1ff0 must reach 0x1ff0 + 4, 8, 12 and 16 bytes. Each case first checks that the encoding decodes to the expected mnemonic.ds_reachchange, the b96/b128 cases fail.Results (Windows 11, WARP):
tombox-xshader --libds_reachchangeds_write_b96at 0x1ff0 reaches 8180, want 8188tombox-xshadersuitetests/exec.rs189/189The PR gate is clean.
🤖 Generated with Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.