victory-shader: lower TFE image loads/samples/gathers via CheckAccessFullyMapped #1692
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1693"
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 Marvisak/VIctory. Originally posted by tjthebigbearcat-hub on 2026-11-24T20:47:54Z.
Summary
Implements TFE (Texture Fetch Enable) sparse-residency status feedback for RDNA 2 image
load,sample, andgatherinstructions (includingd16packing) invictory-shader:dx.op.checkAccessFullyMappedinemit/lower.rsand writes the residency status dword (0resident,1non-resident) to the extra destination register.SFI0bit0x100/ shader-flags metadata) inemit/shader.rswhen TFE status is checked.lweand TFE on stores, atomics, and size/LOD queries cleanly refused with clearer error messages.Verification (Windows 11 + SDK
dxil.dll+ WARP/GPU)emit/tfe_tests.rs(zero game bytes; verified withxtaskasset-policy check).cargo test -p victory-shader --locked tfe: 7 passed, 0 failed (including all 4 Windowsdxil.dll/ WARP / hardware GPU tests).cargo test --workspace --locked: 127 passed, 0 failed, 1 ignored invictory-shader; entire workspace green.cargo clippy --workspace --all-targets --locked -- -D warnings: 0 warnings.Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T20:57:00Z.
Review: APPROVED
Verified locally merged onto
origin/main(Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC, withdxil.dllvalidator):cargo test -p victory-shader --lib emit::tfe_tests::— 7 passed, 0 failed on both RTX 5090 hardware andVICTORY_D3D12_WARP=1cargo clippy -p victory-shader --all-targets— 0 warningscargo xtask policy— okClean lowering of TFE image loads, samples, and gathers via
CheckAccessFullyMappedwith comprehensive end-to-end GPU+WARP test coverage intfe_tests.rs. Looks good.AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T22:20:11Z.
Review: COMMENTED
Merge conflict with current main (
70564ae) — needs a rebase. (Also note: this overlaps in scope with #1687's CheckAccessFullyMapped TFE work; whichever lands second will need to reconcile the two.)Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-24T22:52:54Z.
NVIDIA run: RTX 3070 8 GB, driver 616.56, Windows 11, debug, at the PR head
77d21c6. Tests matchingtfe(the new TFE load / sample / gather / D16 cases and the refusals): 7 passed, 0 failed.It is based on
ffe310eand GitHub shows conflicts withmain70564ae, so this is the head as it stands, not a merge.AI-assisted (Claude Code). Synthetic tests only.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:34:35Z.
Automated triage for the maintainers.
Thanks for the rebase;
39c440bstill merges cleanly and CI (check) passes. It is the same head the previous verdict covered, and as your comment says, the substance is unchanged, so the verdict stays.Still needed:
emit/lower.rsis written0on every non-faulting access. The only hardware evidence in the thread (gfx1036) says the VGPR after the data keeps its old value on ordinary textures. Either leave the register unchanged where the host view cannot be non-resident, or cite a hardware or ISA source that says it is written0.victory translate --listrun onmainrefuses with "an image access with tfe or lwe".emit/mod.rsbullet ("added 2026-11-24").Verdict: needs work. CI: passing.
Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by Headache3318 on 2026-11-25T01:45:33Z.
Tested on Linux (Arch, kernel 7.3.5, 3× RTX 4090 driver 620.73.04), Rust 1.98.1 (pinned). PR head
77d21c6applied cleanly onto currentmainccfb029.cargo test -p victory-shader --locked: 99 passed, 0 failed, 1 ignored. All tests pass, including the 3 TFE tests that run on Linux (the 4 dxil.dll/WARP/GPU tests are Windows-only).cargo clippy -p victory-shader --all-targets -- -D warnings: 2 pre-existing unused-import errors in test code (fail identically on mainccfb029). The PR introduces no new clippy warnings.Not tested: Windows MSVC build, the title itself. AI-assisted.
Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-25T01:50:43Z.
A hardware data point for the status dword, from reading, not a run here: boykopovar/AnyPS5#24954 measured MIMG
tfe/lweon gfx1036 with their hardware oracle, in wave32 and wave64. On ordinary (non-sparse) textures, the VGPR after the data is never written; it keeps its old value. That holds forimage_load,image_load_mip,image_sample_lz/_l,image_gather4_lz, also withd16, for in-bounds and out-of-bounds texels, mips past the last level, and a T#MIN_LOD_WARNabove the LOD.This PR writes
0there. On a non-sparse texture that only differs if a shader reads the status without first setting it, so it's unlikely to matter in practice. Sparse (PRT) textures, where a residency value would actually come from, weren't part of that measurement. Keeping the old register value for non-tiled views (and writing the residency bit only where the host view is tiled) would match it exactly.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by tjthebigbearcat-hub on 2026-11-25T03:19:46Z.
Rebased cleanly onto current
main(940d32f→5d7fca5):lower.rs,mod.rs, andtfe_tests.rswith upstream's newrovs, BVH dispatch, 16-bit biased sample support (0b35b7f), and updated test struct fields.image_bvhto thetferefusal list so ray-tracing BVH instructions withtfefail cleanly rather than translating silently without residency handling.cargo test -p victory-shader --locked tfe(7 passed, 0 failed) andcargo clippy(0 warnings).Imported from Marvisak/VIctory. Originally posted by tjthebigbearcat-hub on 2026-11-26T02:20:32Z.
Rebased onto current
main(63bcca4), new head39c440b. It merges cleanly again.lower.rs,mod.rsandshader.rswere both sides adding code in the same place, so I kept both. Upstream'suses_lane_index/has_half_wave_masktest fields sit next totiled_resources, and its "Read marks" doc paragraph next to "Texel residency". TheUAVS_EVERY_STAGE(0x4) andTILED_RESOURCES(0x100) feature bits are both kept, and no flag bits overlap.cargo test -p victory-shader --locked --lib tfe: 7 passed, 0 failed.cargo clippy -p victory-shader --all-targets --locked -- -D warnings: clean.cargo xtask policy: 192 files ok.cargo test -p victory-shader --locked: 306 passed, 3 failed, 3 ignored. The three failures (stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride,stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros,synthetic_tests::gathers_at_a_level_match_the_hardware) fail the same way on a clean63bcca4on this machine. The stride ones look like the ones already tracked in #1744.lower.rsis now 522,198 B, 2,090 B under the 512 KiB cap.Not changed in this push: the TFE status dword still writes
0on non-sparse textures (upipibi's note above). The overlap with #1687 still needs reconciling, whichever of the two lands second.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.