Repository navigation
Shaders: a biased sample of 16-bit coordinates reads its bias from its own VGPR - #1245
nicogunvis-boop wants to merge 1 commit into
Conversation
f1aabcc to
6751dc7
Compare
|
Setup: Linux, RX 9070 XT, RADV (Mesa 26.3.1), dxil-spirv master, spirv-val 1.3. Your head folded onto a base of origin/main
No program gained or lost and the failure table is identical to the base, reason for reason: nothing in this capture reaches the class you lower, so this is a no-regression result only (same 10 SPIR-V validation failures as the base). Not tested: in-game. |
…s own VGPR
With a16, the words before the coordinates (texel offsets, bias) still take a
whole VGPR each; the bias is an f16 in that VGPR's low half, and the packed
16-bit coordinates start at the next VGPR. image_sample_b with a16 was refused
("a biased image sample with 16-bit coordinates"); it now reads the bias as
f16 from its own VGPR and the coordinates after it. The `_o` samples and
gathers place their 16-bit coordinates after the offset VGPR the same way, and
read the offset word whole.
Measured with `victory translate --validate` on the retail package: the refusal
is gone (108 programs), vertex and pixel programs emitted 12,243 -> 12,287 and
validated 12,167 -> 12,203; of the 108, 36 now validate and the rest stop on
other, already reported causes (48 "a scalar memory read as data", 16 "a lane
mask read as data", 8 an input-signature validator error). No other program's
outcome changed.
6751dc7 to
e6dfe9c
Compare
|
Independent verification of \e6dfe9c\ on Windows 11 / AMD Radeon RX 9060 XT (RDNA4, \gfx1200) / Rust 1.98.1 MSVC:
Two small notes from code review:
AI-assisted; synthetic tests only, no game files. |
|
Automated triage for the maintainers. Closing because this change is already in a16 biased samples are in main's image(), with the same layout (bias f16 in its own VGPR, coordinates packed after). If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution. |
…hange (fork pull request Marvisak#1245, by hand) The count of table changes that a thread's remembered answers hang on was added to BEFORE a registration's insert: a thread that asked between the two kept the old table's answer under the new count until the next change. Now an entry that comes is counted after it is in, a copy that leaves is counted before it leaves, both with the table's lock held, and a thread that finds a remembered answer reads the count again before it uses it. The idle sweep looks at each copy's holders again after it counted, so a copy a thread has just taken from its own memory stays in the table (the pull request takes the windows' lock on every remembered window instead; this keeps the remembered ask free of locks). The pull request's registration test is taken. The cache stays off unless VICTORY_LOOKUP_CACHE=1. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…hange (fork pull request Marvisak#1245, by hand) The count of table changes that a thread's remembered answers hang on was added to BEFORE a registration's insert: a thread that asked between the two kept the old table's answer under the new count until the next change. Now an entry that comes is counted after it is in, a copy that leaves is counted before it leaves, both with the table's lock held, and a thread that finds a remembered answer reads the count again before it uses it. The idle sweep looks at each copy's holders again after it counted, so a copy a thread has just taken from its own memory stays in the table (the pull request takes the windows' lock on every remembered window instead; this keeps the remembered ask free of locks). The pull request's registration test is taken. The cache stays off unless VICTORY_LOOKUP_CACHE=1. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…CBV fixes, dynamic slot ring fix, 64-thread card hash, lookup cache (Marvisak#1245), heap texture worker (Marvisak#1007), card sync batch, table stages/locks, plain fills, step index, tiles/xmem/mouse fixes
What
image_sample_bwitha16was refused with "a biased image sample with 16-bit coordinates". On GFX10, with a16, the words before the coordinates (texel offset, bias) still take a whole VGPR each. The bias is an f16 in the low half of its VGPR, and the packed 16-bit coordinates start at the next VGPR. An instance from the retail title, disassembled locally (registers only):Change (
crates/victory-shader/src/emit/lower.rs)legacyF16ToF32).firstwhole VGPRs (base = 2 * firstaddress components) instead of at componentfirst. This also changes whereimage_sample_o/image_gather4_lz_owith a16 read their coordinates: they previously read the offset VGPR's high half as the first coordinate. The offset word is now read whole in both paths.a_biased_sample_of_16_bit_coordinates_reads_the_bias_from_its_own_vgpr(synthetic program with the same instruction shape). Before the change it is refused.Measured
victory translate --validateon the retail package (Windows 11, dxil.dll from SDK 10.0.26100):Of the 108 formerly refused programs, 36 now validate. The others stop on causes with open PRs: 48 "a scalar memory read as data", 16 "a lane mask read as data", 8 an input-signature validator error. No other program's outcome changed (25,891 compared).
cargo test -p victory-shader --lib emit::lower: 12 passed.cargo clippy -p victory-shader --all-targets -- -D warnings: clean.Not yet checked in a running world frame (the world is black on
main). Tested on an RTX 4070.