GPU: specialize the indirect argument clamp for single records #1014
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1016"
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 fxceless/victory-fork. Originally posted by Lkxex on 2026-11-25T16:18:25Z.
The latest frame breakdown reports about 2,400 indirect calls per frame that still run separate clamps with draw windows enabled, including about 960 compute calls and 1,000 scattered mesh draws. This targets the one-record calls that reach the inline clamp, including pipelines that are ineligible for draw windows.
With VICTORY_INDIRECT_SINGLE=1, one-record calls use a one-thread variant of the existing shader. Both variants share argument decoding, bounds checks and record writes. The specialized shader drops group-memory synchronization and the lane scans, and preserves the saturating atomic budget charge, mesh diagnostics, padding, count-buffer rules and D3D12 barriers. Larger calls and windows continue through the group shader. The switch defaults to off and falls back to the group shader if compilation fails.
RX 6600, 3,200 synthetic indirect draws, GPU timestamp medians of nine samples per case, device-local budget and identical barriers in both cases:
The benchmark includes the clamp and tiny graphics draws. These figures describe the synthetic workload. A game run and NVIDIA measurements are pending.
The diagnostics indirect suite passed 14 tests on Windows with VICTORY_D3D12_DEBUG=1 and VICTORY_INDIRECT_SINGLE=1. The new WARP parity test compares scratch and all three budget words across draw, indexed draw, dispatch and mesh, including a zero count, exact budget fit, saturation, and an unfilled ahead record. The ignored timestamp benchmark also passed on the hardware adapter.
Related: #1001 reduces the number of clamp passes for compatible prefixes. This change reduces the cost of a clamp that runs individually.
AI-assisted.
Imported from fxceless/victory-fork. Originally posted by Filip722 on 2026-11-27T09:29:47Z.
I tried a narrow adaptation of
e377a5c7on the4c60466line for the classic spread-dispatch record. In the RTX 5060 Laptop cell replay, that layout accounts for about 909 standalone dispatch clamps per frame. The adaptation keeps the existing record decoder, output layout and command barriers. It limits the one-thread selection to a single classic spread record.A physical RTX 5060 Laptop fixture on Bazzite, NVIDIA 615.78.08, GE-Proton11-14 and vkd3d-proton 3.2.0 compared the original and one-thread kernels. The test verified that the distinct kernel actually ran. All six readbacks matched, including the 65,535 boundary, 115,200 groups, zero count, exact budget fit and one unit short. It checked the argument record, scratch padding and all six budget words. This result is synthetic parity for the adaptation, with gameplay timing still pending.
Assisted by Codex (GPT-6.2-Sol High).
Imported from fxceless/victory-fork. Originally posted by Filip722 on 2026-11-27T11:53:03Z.
I followed up with a same-process on/off measurement of this specialization on the same Series S RTX 5060 Laptop fixture platform. The diagnostic port used the same classic group and single-record implementations from the earlier test, with a 20-second alternate switch. All six physical readback cases passed again.
Four complete 18-second windows held the initial rendered cell view. The two ON windows returned 5.263 and 5.313 unique Presents per second. The two OFF windows returned 5.317 and 5.249. The draw counts were approximately 4,370–4,393 per frame and the median frame intervals were 186–188 ms. Camera input visibly moved the rendered view after the benchmark. Later windows contained a larger draw-count and frame-time change, so I used the four earlier windows for the comparison. This run supports the earlier correctness result, with nearly identical steady-view throughput.
Assisted by Codex (GPT-6.2-Sol High).
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.