Stability: bound direct compute dispatch work #79

Open
space-de wants to merge 1 commit from upstream-pr/79 into main
space-de commented 2026-11-24 21:18:52 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by space-de on 2026-11-24T21:18:52Z.


Summary

Bound direct compute dispatches before recording them. D3D12 allows at most 65,535 groups in each dimension (Microsoft documentation); the existing indirect path also limits total groups to 1<<20. Direct dispatches previously passed the title's counts straight to D3D12.

Counts outside either limit are dropped, reported once, and included in diagnostics. If the dispatch belongs to the ray-tracing structure builder, the builder is disabled for the run because its stages must run all or none.

This is a defensive guard for malformed or pathological direct counts. I found no current report showing that an oversized direct dispatch caused a hang, so this is not presented as a fix for a confirmed FPS regression.

Tradeoff

A legitimate direct dispatch above these existing indirect-work limits will now be dropped, which can omit GPU work. Typical recorded dispatches should be checked on hardware before raising or changing the caps.

Validation

  • git diff --check passed.
  • cargo check -p victory-gpu passed.
  • cargo clippy -p victory-gpu -- -D warnings passed.
  • No tests or in-game run were performed.
  • Checked the current open PRs; no direct-dispatch bound was already proposed.
<!-- greyfinch-sync:fxceless/victory-fork:issue:6591621640 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/79). Originally posted by [space-de](https://github.com/space-de) on 2026-11-24T21:18:52Z. --- ## Summary Bound direct compute dispatches before recording them. D3D12 allows at most 65,535 groups in each dimension ([Microsoft documentation](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12graphicscommandlist-dispatch)); the existing indirect path also limits total groups to 1<<20. Direct dispatches previously passed the title's counts straight to D3D12. Counts outside either limit are dropped, reported once, and included in diagnostics. If the dispatch belongs to the ray-tracing structure builder, the builder is disabled for the run because its stages must run all or none. This is a defensive guard for malformed or pathological direct counts. I found no current report showing that an oversized direct dispatch caused a hang, so this is not presented as a fix for a confirmed FPS regression. ## Tradeoff A legitimate direct dispatch above these existing indirect-work limits will now be dropped, which can omit GPU work. Typical recorded dispatches should be checked on hardware before raising or changing the caps. ## Validation - `git diff --check` passed. - `cargo check -p victory-gpu` passed. - `cargo clippy -p victory-gpu -- -D warnings` passed. - No tests or in-game run were performed. - Checked the current open PRs; no direct-dispatch bound was already proposed.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/79:upstream-pr/79'
git switch 'upstream-pr/79'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/79'
git switch 'upstream-pr/79'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/79'
git switch 'upstream-pr/79'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/79'
git switch 'main'
git merge --squash 'upstream-pr/79'
git switch 'main'
git merge --ff-only 'upstream-pr/79'
git switch 'main'
git merge 'upstream-pr/79'
git push origin 'main'
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
fxceless/victory-fork!79
No description provided.