Fix NVIDIA wave32 lane numbering and skip unsupported texture readbacks (11.28.03 backport) #3081

Closed
github-bot wants to merge 8 commits from github-bot/gh-3081 into main AGit
Owner

@⁠EternalAtake1 on GitHub · 2026-11-29 19:54 UTC · original
EternalAtake1:fix/11-28-rendering → main · +530 −32 · 9 files · 8 commits · closed without merging

This v2026.11.28.03 backport preserves Xbox lane numbering in the triangle-collection shaders on NVIDIA wave32 hardware. It also restores CPU readback of the ocean height map and skips GPU copies for texture layouts the CPU cannot decode.

Offline tests matched all 65,536 height-map texels against Series S and Series X reference results. A D3D12 WARP test verified one copy after repeated writes to a supported texture and zero for an unsupported layout. In-game performance was not measured.

Current main already includes the height-map addressing from #892. The lane-numbering fix and the readback guard adapted from #881 are the changes to review when reconciling conflicts. The upload-sizing change is also submitted separately in #3078.

**@⁠EternalAtake1** on GitHub · 2026-11-29 19:54 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3081) `EternalAtake1:fix/11-28-rendering` → `main` · +530 −32 · 9 files · 8 commits · closed without merging This v2026.11.28.03 backport preserves Xbox lane numbering in the triangle-collection shaders on NVIDIA wave32 hardware. It also restores CPU readback of the ocean height map and skips GPU copies for texture layouts the CPU cannot decode. Offline tests matched all 65,536 height-map texels against Series S and Series X reference results. A D3D12 WARP test verified one copy after repeated writes to a supported texture and zero for an unsupported layout. In-game performance was not measured. Current main already includes the height-map addressing from #892. The lane-numbering fix and the readback guard adapted from #881 are the changes to review when reconciling conflicts. The upload-sizing change is also submitted separately in #3078.
vfx_triangleClip:CS_CollectTriangles (#6832a9da15c2e584) and _Meshlets
(#6b82bc7d22016cb5), groups of 1024 using all 32 KiB of LDS, stopped with
"no wave32 lowering for this wave64 program" on 32-lane hosts, and their
dispatches were dropped. Wave-wide branches cannot take them: their meetings
need 177 dwords past the program's 8192, which a D3D12 group never has.

Their LDS is only shared across the title's own barriers; between them it holds
atomics, reads of what the last barrier fixed, and one region thread 0 runs
alone. Their wave operations are the allocation idiom, with the reservation on
an LDS counter (ds_add_rtn_u32) instead of a buffer. So each host wave can run
as a wave of its own:

- wave_local takes an LDS atomic of the total's operation (ds_add/min/max/or/
  and/xor, with or without _rtn) as a reservation, as it takes buffer atomics.
- Local waves compute LdsOrder too, but only for a program whose LDS accesses
  cannot be ordered without it; every other program keeps its barriers.
- tight_lds: with local waves, a one-dimensional group whose own LDS leaves no
  room makes neither the exchange dwords (local waves never exchange) nor
  wave_base's counter (the flat id's 32-aligned runs are the host waves).

All 26177 programs of GTA VI 1.0.2.1 translated before and after (32-lane host):
only these two differ, both from refused to emitted; every other program's DXIL
is the same. victory-shader tests: 288 passed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FsQtBz4aDhUTip3jBagKEX
(cherry picked from commit 9a64b31985)
`wave_local` took a VGPR that a guarded write left with a wave-dependent value
in the lanes outside the guard as mixed for every later read. A read in the same
block under the same guard only runs in the lanes that wrote it, so it now reads
the new value. Another guarded write over such a value keeps it that way.

`CS_CollectTriangles(_Meshlets)` load into the VGPR that held the wave's count
(0x3acc / 0x34c4) and read it only under the load's guard: both now pass as
the exact `local waves (idiom)` form, with the same DXIL as the approximate
form gave them. Every other program of GTA VI 1.0.2.1 is unchanged
(VICTORY_HOST_WAVE=32, all outcomes and DXIL hashes identical).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 05d7e0a310)
(cherry picked from commit 90826c94d0)
List uploads in this release already request exactly their payload. Only the submission snapshot rounds past its spare-pool limit.
Use one scratch-layout decision for proven, complete 1-D console waves. Leave room for both halves elsewhere and refuse local wave scratch beyond the host limit. Re-evaluate guarded SSA definitions at the fixed point and match DS atomic operations without allocating strings.

Synthetic allocation and lane-readback coverage adapted from trustno1-coder/VIctory-NVIDIA#822. The tests cover a full group store and reject the two-dimensional scratch-free case.
The title's CPU code reads the ocean's 256x256 R32_FLOAT height map,
which its wave passes write, and texback copies it into title memory in
the console's layout. That texture is in SW_64KB_R_X, a pipe and bank
XOR mode the tiler had no addressing for, so the copy back could not be
tiled and the CPU read what was in that memory before. The logs of
#788, #853 and #859 each have "a texture copied back could not be tiled
e=Unsupported"; the warning does not say for which texture.

victory-formats: Layout::configure_render_xor addresses that one layout
(a 256x256 plane of 4-byte elements, one mip, a 64 KiB-aligned
allocation) with addrlib's GFX10_SW_64K_R_X_1xaa_RBPLUS equations for
the console's pipes and packers: Series S 8 and 4, Series X 32 and 8.

victory-gpu: title_texture sets it for an R32_FLOAT texture at a
64 KiB-aligned address, by the console the title runs as. A texture
whose layout still cannot be addressed is left alone before any copy is
recorded, with one warning that names its size, format and swizzle.

From DoubleGhosty/cool_fox d9f3ea6f8 ("Support the aligned water height
texture readback for boat missions"). The test's digests come from
XCL's independent GFX10 tiler.

(cherry picked from commit a23118376d)
#881 skips the copy back of a texture whose layout the tiler cannot
address, at the list, with a test on WARP. This change also returned no
target for such a texture: the same skip twice, and #881 came first. So
title_texture only sets the XOR addressing now, and its test checks what
it gives: the layout addressed or not, at the right place and size.

(cherry picked from commit 7f6e2aa47e)
Adapt upstream PR #881 (05bb2d3b) to the Series X/S height map backport. Verify that repeated writes to both supported layouts produce one readback per list and that the unsupported layout produces no state transition or copy.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 20:00:07 +00:00
github-bot closed this pull request 2026-12-01 18:59:11 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!3081
No description provided.