GPU: fix indirect mesh dispatches when the console supplies only X #996

Merged
invismann merged 1 commit from upstream-pr/996 into main 2026-11-29 08:16:57 +00:00
invismann commented 2026-11-28 10:54:32 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by invismann on 2026-11-28T10:54:32Z.


On the Series X profile, some terrain rendered black even though its depth was present. A terrain tessellation batch submitted records such as (1593, 0, 0). The console uses X as the mesh group count. Passing the zeros through to Direct3D 12 cancels the dispatch.

The single-record and batched clamps now submit (X, 1, 1) for valid mesh records and charge the list budget for X groups. The existing rejection of out-of-range X values stays in effect, including unused slots filled with 0xffffffff.

Before and after

I replayed the same Series X frame on an RTX 4090, replacing only the batched argument clamp. Each sample covers 80 by 40 pixels of the affected terrain. A pixel counts as near-black if all three RGB channels are below 16 out of 255.

Terrain sample Near-black pixels before Near-black pixels with the fix
Left patch 3,086 of 3,200 0 of 3,200
Right patch 2,490 of 3,200 0 of 3,200

Validation

  • The recorded (1593, 0, 0) case failed the WARP regression before the fix. The windowed and single-record paths now produce (1593, 1, 1). Batch coverage checks the dispatch arguments and budget, and the tests also check unused slots and preserved record padding.
  • On an RTX 4090, replaying the same Series X frame with only the batch clamp replaced restored the missing road shoulder and terrain under the grass. The reporter also confirmed the terrain looks correct in live play.
  • Nine focused WARP tests passed on this branch. The integration build containing the patch also passed the release and diagnostics builds and the replay regression.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5539375091 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/996). Originally posted by [invismann](https://github.com/invismann) on 2026-11-28T10:54:32Z. --- On the Series X profile, some terrain rendered black even though its depth was present. A terrain tessellation batch submitted records such as `(1593, 0, 0)`. The console uses X as the mesh group count. Passing the zeros through to Direct3D 12 cancels the dispatch. The single-record and batched clamps now submit `(X, 1, 1)` for valid mesh records and charge the list budget for X groups. The existing rejection of out-of-range X values stays in effect, including unused slots filled with `0xffffffff`. ## Before and after I replayed the same Series X frame on an RTX 4090, replacing only the batched argument clamp. Each sample covers 80 by 40 pixels of the affected terrain. A pixel counts as near-black if all three RGB channels are below 16 out of 255. | Terrain sample | Near-black pixels before | Near-black pixels with the fix | | --- | ---: | ---: | | Left patch | 3,086 of 3,200 | 0 of 3,200 | | Right patch | 2,490 of 3,200 | 0 of 3,200 | ## Validation - The recorded `(1593, 0, 0)` case failed the WARP regression before the fix. The windowed and single-record paths now produce `(1593, 1, 1)`. Batch coverage checks the dispatch arguments and budget, and the tests also check unused slots and preserved record padding. - On an RTX 4090, replaying the same Series X frame with only the batch clamp replaced restored the missing road shoulder and terrain under the grass. The reporter also confirmed the terrain looks correct in live play. - Nine focused WARP tests passed on this branch. The integration build containing the patch also passed the release and diagnostics builds and the replay regression.
CristianCiubancan commented 2026-11-28 12:22:38 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by CristianCiubancan on 2026-11-28T12:22:38Z.


Independent confirmation, found separately before I saw this PR.

On an RTX 5070 Ti (Series X profile) I recorded a frame at the beach where the sand and seabed vanish up close. The records the title's meshlet_tessellation:CS_CalcChunkOffsets writes for the MST_DS_TerrainTransform draws read (2, 0, 0), (6, 0, 0), (4, 0, 0); other mesh draws in the same buffer read (x, 1, 1). After the clamp, the scratch copies still had y and z at zero.

Replaying that frame with only the batched clamp replaced (y = z = 1):

G-buffer of the recorded frame Empty pixels
Clamp as on main 45.2%
Corrected clamp 0.0%

The sandy bottom and seagrass are drawn across the whole view afterwards. This looks like the cause of #583, #701 and #765 (black beach, exposed seabed), which this PR could close.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7239184412 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/996#issuecomment-7239184412). Originally posted by [CristianCiubancan](https://github.com/CristianCiubancan) on 2026-11-28T12:22:38Z. --- Independent confirmation, found separately before I saw this PR. On an RTX 5070 Ti (Series X profile) I recorded a frame at the beach where the sand and seabed vanish up close. The records the title's `meshlet_tessellation:CS_CalcChunkOffsets` writes for the `MST_DS_TerrainTransform` draws read `(2, 0, 0)`, `(6, 0, 0)`, `(4, 0, 0)`; other mesh draws in the same buffer read `(x, 1, 1)`. After the clamp, the scratch copies still had y and z at zero. Replaying that frame with only the batched clamp replaced (y = z = 1): | G-buffer of the recorded frame | Empty pixels | | --- | ---: | | Clamp as on main | 45.2% | | Corrected clamp | 0.0% | The sandy bottom and seagrass are drawn across the whole view afterwards. This looks like the cause of #583, #701 and #765 (black beach, exposed seabed), which this PR could close.
Marsietiss commented 2026-11-29 13:49:45 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Marsietiss on 2026-11-29T13:49:45Z.


A result from normal play, to go with the replay test above.

What we tested: our fork has a port of this change, together with https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1183 and a one-line change from another fork that keeps an X=0 record as (0,0,0). RTX 5080 16 GB, Ryzen 9 9950X3D, Series S mode, 1080p.

Result: our previous build had black squares along the shore. With these changes in, they were gone at the coastline spot we checked, by eye. Frame time at our separate heavy spot was about the same: 47.8 and 48.0 ms at about 6.7k draws, against 47.35 ms at about 7.0k draws on the previous build.

Limits: we tested the three changes together, in a build that also had other fixes, so we can't say how much came from this PR alone. The picture check was by eye, with no pixel counts. The frame times come from separate builds and slightly different draw counts, so they only show that we saw no large slowdown.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7256831913 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/996#issuecomment-7256831913). Originally posted by [Marsietiss](https://github.com/Marsietiss) on 2026-11-29T13:49:45Z. --- A result from normal play, to go with the replay test above. **What we tested:** our fork has a port of this change, together with https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1183 and a one-line change from another fork that keeps an X=0 record as (0,0,0). RTX 5080 16 GB, Ryzen 9 9950X3D, Series S mode, 1080p. **Result:** our previous build had black squares along the shore. With these changes in, they were gone at the coastline spot we checked, by eye. Frame time at our separate heavy spot was about the same: 47.8 and 48.0 ms at about 6.7k draws, against 47.35 ms at about 7.0k draws on the previous build. **Limits:** we tested the three changes together, in a build that also had other fixes, so we can't say how much came from this PR alone. The picture check was by eye, with no pixel counts. The frame times come from separate builds and slightly different draw counts, so they only show that we saw no large slowdown.
Sign in to join this conversation.
No reviewers
No labels
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.

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