GPU: pipelines that write depth only go first among early starts #2897
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2897
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2897"
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?
@0xkn0wh3r3 on GitHub · 2026-11-25 23:21 UTC · original
0xkn0wh3r3:gpu/depth-only-pipelines-first-among-early-builds→main· +92 −6 · 2 files · 2 commits · openWhat
Pipelines an earlier run drew with are started while the title loads (early starts), in the order the title creates them, after the pipelines draws are waiting for. A shadow map's or depth prepass's pipeline feeds several later draws in a frame, and those draws wait for it too.
Early starts that write depth and no colour now get a queue of their own. That means no render target, a depth format, and depth writes on (
GraphicsState::writes_depth_only). Workers take from it after the queue draws wait for and before the other early starts (queue_index). Draws that are waiting still come first.Where it came from
From DexNom's fork, DexNom/VIctory@921d8d3 (
Queue.early_depth,GraphicsState::writes_depth_onlyand its queue test), built on this tree'sQUEUES. Credited withCo-authored-by: DexNom.Tested
pipeline::make::tests::depth_only_pipelines_go_ahead_of_other_early_starts: an early start that writes depth only goes in queue 1, another early start in queue 2, and either one, when a draw waits for it, in queue 0.VICTORY_DEPTH_ONLY_FIRST=0: a depth-only early start then goes in queue 2 with the others.cargo test -p victory-gpu(Windows 11, RTX 5070 Ti): 230 passed. The 2 known NVIDIA failures are fixed by #2121.cargo clippy -p victory-gpu --all-targets -- -D warnings, with and without--features diagnostics: clean.Measuring it
Draw waits for pipelines are counted from the start and logged with each batch of pipelines made, on the
host pipelines all madeline:draw_waits: draws that waited for their pipeline;draw_waited_ms: the time they waited in all;draws_without: draws whose frame budget ran out first, so they were drawn without the pipeline.VICTORY_DEPTH_ONLY_FIRST=0turns the depth-only queue off. To compare on one build:host pipelines all madeline once the world is reached.VICTORY_DEPTH_ONLY_FIRST=0.Not tested
Which order of early starts helps is a question of what the world's first frames wait for, with a cold pipeline library. The draws that waited for their pipeline, the time they waited in all, and those whose frame budget ran out first (drawn without it) are now counted from the start and logged with each batch of pipelines made ("host pipelines all made": draw_waits, draw_waited_ms, draws_without). VICTORY_DEPTH_ONLY_FIRST=0 puts depth-only early starts back with the others, so one build can be compared with and without the queue. Test: depth_only_pipelines_go_ahead_of_other_early_starts also checks the switch.@Marvisak on GitHub · 2026-11-26 04:30 UTC · original · edited 2026-11-26 07:23 UTC
Automated triage for the maintainers.
Needs work (unchanged). The new commit
5f82c56inpipeline/make.rsaddsDRAW_WAITS,DRAW_WAITED_USandDRAWS_WITHOUT, counted inwait. They are logged on thehost pipelines all madeline indrained.VICTORY_DEPTH_ONLY_FIRST=0turns the depth-only queue off through the newqueue_for. The counters read correctly: every wait is counted, and a draw that leaves without its pipeline is counted indraws_without.Thank you for making it measurable. The verdict still depends on the measurement, though: a cold-library run each way with the three counts from the last line. Once those numbers are posted here, this can be judged on the result. If the depth-only queue is kept, the comparison switch could be dropped then.
CI: passing.
Generated by Claude Code
@0xkn0wh3r3 on GitHub · 2026-11-26 07:05 UTC · original
Agreed, it's unmeasured. I can't run the title, so
5f82c56makes it measurable instead:host pipelines all madeline:draw_waits,draw_waited_ms, anddraws_without(frame budget ran out, drawn without the pipeline).VICTORY_DEPTH_ONLY_FIRST=0turns the depth-only queue off, so one build can be compared both ways.A tester could clear the pipeline library, reach the world, and note the last line's counts. Then clear it again and repeat with
VICTORY_DEPTH_ONLY_FIRST=0. If anyone can run that, the numbers would settle it. Until then I'm not claiming a gain, and I understand if this stays open.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.