GPU: forward all dimensions of direct mesh dispatches #1431

Manually merged
github merged 1 commit from github-bot/gh-1431 into main 2026-11-29 08:22:02 +00:00 AGit
Owner

@⁠ghptc on GitHub · 2026-11-28 19:46 UTC · original
ghptc:fix/nvidia-direct-mesh-grid → main · +43 −24 · 2 files · 1 commits · merged 2026-11-29 08:16 UTC

Summary

The direct List6 entry currently replaces both Y and Z with one. It turns a 4 × 3 × 2 call into a 4 × 1 × 1 draw and produces geometry when Y or Z is zero.

Forward all three axes, preserve the NVIDIA fork's existing per-axis clamp and check the aggregate D3D12 limit in 64-bit arithmetic before recording the draw. The separate direct DispatchMeshX entry supplies [x, 1, 1]. D3D12 group limits

The direct forwarding behavior was proposed independently on the sibling project in Marvisak/VIctory #2624. The zero-axis case also overlaps #2014. This port keeps the NVIDIA bounds behavior and includes an exact-fork pixel comparison. Indirect record layouts are tracked separately in #996.

Physical regression

RTX 5070, NVIDIA 620.73.04, Proton Experimental 11.0-20261123b and VKD3D-Proton. The same generated mesh shader, four-texel texture and lighting produce a 99 × 65 RGBA8 image in both builds. The test compares every pixel after the submission fence. The baseline is NVIDIA main at 923e38cc8c92cd1c42090076382138538f2bb487. Both builds carry the identical diagnostics-only fixture.

Case Baseline wrong pixels With this patch
Native D3D12, 4 × 3 × 2 0 0
VIctory List6, 4 × 3 × 2 2,880 0
VIctory List6, zero Y 576 0
VIctory List6, zero Z 576 0

The CPU bounds test accepts 4,194,303 groups and rejects 4,194,304 without enqueueing an oversized grid. Both controls also check the original X clamp.

The generated fixture commit can be applied on either source revision. Build the Windows victory-gpu library tests in release with --features diagnostics, set VICTORY_PC_DXC to Microsoft dxc.exe and run --exact pipeline::host::direct_mesh::direct_mesh_pixels --ignored --nocapture --test-threads=1. The CPU selector is draw::tests::direct_mesh_grid_limits.

The workload uses generated inputs and test-supplied descriptors. The measured result covers direct dispatch and offscreen pixel correctness on the stated stack.

**@⁠ghptc** on GitHub · 2026-11-28 19:46 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1431) `ghptc:fix/nvidia-direct-mesh-grid` → `main` · +43 −24 · 2 files · 1 commits · merged 2026-11-29 08:16 UTC ## Summary The direct List6 entry currently replaces both Y and Z with one. It turns a 4 × 3 × 2 call into a 4 × 1 × 1 draw and produces geometry when Y or Z is zero. Forward all three axes, preserve the NVIDIA fork's existing per-axis clamp and check the aggregate D3D12 limit in 64-bit arithmetic before recording the draw. The separate direct `DispatchMeshX` entry supplies `[x, 1, 1]`. [D3D12 group limits](https://microsoft.github.io/DirectX-Specs/d3d/D3D12IncreasedDispatchDimension.html#d3d12_feature_data_d3d12_options25) The direct forwarding behavior was proposed independently on the sibling project in [Marvisak/VIctory #2624](https://github.com/Marvisak/VIctory/pull/2624). The zero-axis case also overlaps [#2014](https://github.com/Marvisak/VIctory/pull/2014). This port keeps the NVIDIA bounds behavior and includes an exact-fork pixel comparison. Indirect record layouts are tracked separately in [#996](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/996). ## Physical regression RTX 5070, NVIDIA 620.73.04, Proton Experimental 11.0-20261123b and VKD3D-Proton. The same generated mesh shader, four-texel texture and lighting produce a 99 × 65 RGBA8 image in both builds. The test compares every pixel after the submission fence. The baseline is NVIDIA main at `923e38cc8c92cd1c42090076382138538f2bb487`. Both builds carry the identical diagnostics-only fixture. | Case | Baseline wrong pixels | With this patch | | --- | ---: | ---: | | Native D3D12, 4 × 3 × 2 | 0 | 0 | | VIctory List6, 4 × 3 × 2 | 2,880 | 0 | | VIctory List6, zero Y | 576 | 0 | | VIctory List6, zero Z | 576 | 0 | The CPU bounds test accepts 4,194,303 groups and rejects 4,194,304 without enqueueing an oversized grid. Both controls also check the original X clamp. The [generated fixture commit](https://github.com/ghptc/VIctory-NVIDIA/commit/dd68330872636cdba712486b09a385f2c0d80b42) can be applied on either source revision. Build the Windows `victory-gpu` library tests in release with `--features diagnostics`, set `VICTORY_PC_DXC` to Microsoft `dxc.exe` and run `--exact pipeline::host::direct_mesh::direct_mesh_pixels --ignored --nocapture --test-threads=1`. The CPU selector is `draw::tests::direct_mesh_grid_limits`. The workload uses generated inputs and test-supplied descriptors. The measured result covers direct dispatch and offscreen pixel correctness on the stated stack.
Preserve the NVIDIA fork's existing per-axis clamp and reject grids over the D3D12 aggregate limit. The separate DispatchMeshX direct entry remains one-dimensional.

The direct forwarding behavior was independently proposed on the sibling fork in Marvisak/VIctory#2624 and the zero-axis case in Marvisak/VIctory#2014. This adapts the NVIDIA-specific bounds-checked port fce1417864402c51cb949da93d1352f8704c9a8b to its current main.

Co-authored-by: andrewpozdnakov7-jpg <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 19:49:22 +00:00
Author
Owner

@⁠nick0451 on GitHub · 2026-11-28 21:44 UTC · original

A smoke test in play: RTX 3090 24 GB (driver 610.88), i9-14900K, Windows 11. A release build of this PR merged onto main 923e38c, run in turn with main and three other PR builds. Series S, DLSS Performance, frame generation off. The same frozen save, outdoors on a balcony, standing still. Two rounds, each run 40 s to settle and 60 s measured, then a screenshot.

  • No crash, device loss or ERROR line. The picture matches main (mean pixel difference against main 1.8, inside the run-to-run variation), and the draws per frame are the same.
  • fps in round 2: 23.4 against main 23.0-23.5 (round 1 was slow for every new build in the session).
  • So no direct mesh dispatch here visibly depended on the old [x, 1, 1]. A scene with the mesh geometry you saw wrong would be the real test.

Tested with an AI assistant (Claude Code); results are from this PC.

**@⁠nick0451** on GitHub · 2026-11-28 21:44 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1431#issuecomment-7246237610) A smoke test in play: RTX 3090 24 GB (driver 610.88), i9-14900K, Windows 11. A release build of this PR merged onto main `923e38c`, run in turn with main and three other PR builds. Series S, DLSS Performance, frame generation off. The same frozen save, outdoors on a balcony, standing still. Two rounds, each run 40 s to settle and 60 s measured, then a screenshot. - No crash, device loss or `ERROR` line. The picture matches main (mean pixel difference against main 1.8, inside the run-to-run variation), and the draws per frame are the same. - fps in round 2: 23.4 against main 23.0-23.5 (round 1 was slow for every new build in the session). - So no direct mesh dispatch here visibly depended on the old `[x, 1, 1]`. A scene with the mesh geometry you saw wrong would be the real test. Tested with an AI assistant (Claude Code); results are from this PC.
github manually merged commit 6a3e77c36e into main 2026-11-29 08:22:02 +00:00
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!1431
No description provided.