draw: a draw record after a compute write opens a new indirect batch (#523) #597
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem!597
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-597"
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?
@t-jonesy on GitHub · 2026-12-05 14:19 UTC · original
t-jonesy:up/indirect-split→main· +78 −4 · 3 files · 1 commits · openFixes #523.
Problem
#523 describes it in full. In short, the title culls and then draws several times over one 32 KiB ExecuteIndirect argument buffer:
C c K, then kind-10 mesh draws, and the next group reuses the same argument addresses.On main,
State::batched()keeps the open batch when onlybuffers_written()has setwrote. The batch is dropped only atsynced(). So a later group's draws can be served by the batch opened for an earlier group, whose clamp pass ran before this group's culling rewrote the counts. Vehicle bodies then go missing or solid black at some camera angles.Change
This is the variant in the last row of #523's table:
open_batchtakes awaitflag, so the clamp pass waits for COMPUTE (around(.., wait)).VICTORY_INDIRECT_SPLIT_AFTER_WRITE=0gives the old behaviour.indirect draw batches opened anew after a compute write per frame, counts the splits. It is logged only when there are any.splits_after(kind, wrote), so a pure unit test pins it.Default
This PR turns the fix on by default. It is a correctness fix for a reproducible picture bug, its reporter measured no cost, and we measured none. If you would rather have it opt-in at first, as #523's patch was written, flipping it is a one-line change.
Evidence
Risks
Switches
VICTORY_INDIRECT_SPLIT_AFTER_WRITE10: as beforeDocumented in
docs/SETTINGS.md(Textures and glass, with the other picture fixes; happy to move it).Testing
draw::tests2 passed, including the newa_draw_after_a_compute_write_opens_a_new_batch. It covers draws, indexed draws and mesh dispatches after a COMPUTE write, the no-write and draws-only cases, and that dispatches never split../build.sh check(victory, Windows target) andcargo check --tests -p victory-gpuare clean, apart from main's existingroom_latelywarning.indirect::tests: its oneopen_batchcall passeswait = false. It was not run here, because it needs a GPU.Open questions
🤖 Generated with Claude Code
https://claude.ai/code/session_01ETU6PfySRvsjk18uHFtWya
17ed40ef32tob9e685bc32View 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.