Skip to content

GPU: a mesh dispatch with an empty dimension runs nothing - #2014

Open
artor410 wants to merge 1 commit into
Marvisak:mainfrom
artor410:mesh-groups
Open

artor410 wants to merge 1 commit into
Marvisak:mainfrom
artor410:mesh-groups

Conversation

@artor410

Copy link
Copy Markdown
Contributor

Summary

Split from #24, as the triage there suggested: only the direct DispatchMesh fix.

-  if y * z != 1: warn          // overflows in debug; y or z = 0 still ran x groups
-  dispatch_mesh(x)
+  mesh_groups(x, y, z): none if any dimension is 0 (as D3D12), else x (y/z != 1 still warned once)

Evidence

No game files used; untested against the game. New test mesh_dispatches_run_x_groups_unless_empty: (5,1,1) → 5; (0,1,1), (5,0,1), (5,1,0) → none; (5,2,3) → 5; (5,MAX,MAX) → 5 with no overflow.

cargo test -p victory-gpu --lib: 142 passed, 2 failed (dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views, which fail on main too). Changed lines are rustfmt-clean.

Merge Danger

Door: two-way

Blast Radius: small. Only a DispatchMesh with a zero dimension changes (it no longer draws).

🤖 Generated with Claude Code

DispatchMesh checked y * z != 1, which overflows in debug builds, and a
dispatch with y or z = 0 still ran its x groups. mesh_groups runs none
when any dimension is 0, as D3D12 does.

Split from Marvisak#24.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zhaibingye added a commit to zhaibingye/VIctory that referenced this pull request Nov 25, 2026
A zero group dimension does not submit work. Preserve existing nonzero
behavior and avoid multiplying the other dimensions for the warning.

Portable helper regression and Windows MSVC test compilation passed.
@upipibi

upipibi commented Nov 25, 2026

Copy link
Copy Markdown

Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at 10be798. victory-gpu: 142 passed, 2 failed, 2 ignored; the new mesh_dispatches_run_x_groups_unless_empty passes. The 2 are #1744's NVIDIA failures on main (dynamic_slots_are_held_until_released and lists_share_a_table_and_copies_keep_their_views, the heap-cap ones). Same as main on this hardware. Not run: a title.

AI-assisted (Claude Code).

@catminou4 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.

Mesh dispatch with an empty dimension runs nothing — degenerate-dispatch guard; cheap correctness fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants