WIP: perf(vk): parts of 240 draws, the frame's GPU idle measured, and the draw code's key and bound state made pure #1354
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1354
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:perf/frame-pipeline"
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?
Type: perf · Risk: medium · Tested on: Linux, RTX 3090 · Needs: Windows; AMD; Intel (part ends have caused picture bugs there)
Why
Tracks C and D of the renderer rework plan: the frame and the draw code. This is the one pull request for both; it took in #1340. Stacked on #1309 and #1339: review the commits after them. What the measuring found: a Kokiri Forest frame is 15 ms with 11 ms of GPU work; the rest is the GPU waiting for its first work at the frame's start, because the game waits for the frame before to finish. See #916.
What changed
Read the commits in order; each stands alone.
vk: frame overlap), the presenter thread takes the swapchain alone, anddocs/development/frame-pipeline.mdrecords a frame's sequence, the numbers and what was tried and removed.vk: frame ahead): recording ahead of the signal was measured and dropped.draw_key.h, and their checks include it instead of cutting text.Measurements
Verdict: Kokiri Forest about 8% faster from the part size alone (63.0 to 67.9 fps over six interleaved sessions each), the Market about 3%, Hyrule Field the same. Nothing else here changes fps.
main, three interleaved pairs: Kokiri Forest 65.5, 65.1, 66.2 against 63.2, 64.9, 63.2; the Market 70.3, 71.0, 69.5 against 68.8, 72.7, 68.0; Hyrule Field 90.8, 88.4, 88.5 against 90.3, 90.6, 90.7: two of three sessions about 2% lower, inside the spread but in one direction, and not yet measured further.Testing
Tested:
python -I -B tests/run_all.py: 665 passed, 44 failed, 19 skipped. Onmainat8e9cfc3athis PC has 46 checks failing (648 pass, 19 skipped); none of them is new here.Not tested:
Must be tested:
@Beanstalk windows amd and windows intel: main against this PR, Kokiri Forest, Hyrule Field, the Market).Risks
What could break: a picture bug at a part end on a driver this PC does not have; lower fps on a slow CPU; a changed pipeline key would rebuild players' pipelines (checked: it did not here).
Turning it off:
RX_VK_CHUNK=120for the part size; the rest has no behaviour to turn off.Compatibility: none: no cache is rebuilt,
MKWVK_API_VERSIONstays.Issues
See #916
Checklist
Everyone
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
https://claude.ai/code/session_017vw8dzCsAL3UdW7ft8ptL9
Tested in game: Linux, RTX 3090, NVIDIA 620.70: eight sessions at 240 a part through Kokiri Forest, Hyrule Field and the Market at 2560x1440; Kokiri 63.0 -> 67.9 fps over six interleaved sessions each, scenes drew as at 120.
Possibly related, for context:
A second commit is on this branch: counters, a presenter-thread fix and a new page, no change to fps.
vk: frame overlapsays how long the GPU sat idle between a frame's recordings and how long it spent in their uploads, by place in the frame. Kokiri Forest here:up to a frame's first recording with a draw 1.92 + 0.28 (the window's copy is in the idle), after it 0.68 + 0.59, of a 15.6 ms frame with 11.0 ms of GPU work.present_imagewaits for the presenter thread before it acquires the next image, so the swapchain is used by one thread at a time (only withRX_VK_PRESENT_THREAD=1).docs/development/frame-pipeline.md(new) has a frame's sequence on every thread, the measured numbers, and what was tried and taken out again: answering the game's frame wait early (its ceiling measured 0.00 ms), short first parts (the GPU's wait for its first work fell from 2.4 to 1.5 ms and the same idle appeared mid-frame; fps the same over three interleaved pairs), lifting the frame gate with the presenter thread (3 to 5%, and the gate's reason stands).One more session of the final build, nothing set: Kokiri Forest 65.0 fps, Hyrule Field 91.2, the Market 72.3; no error line.
tests/test_frame_overlap.pyis new and has not run.0802270b5e171722ca74WIP: perf(vk): a long submission goes to the GPU in parts of 240 draws, not 120to WIP: perf(vk): parts of 240 draws, the frame's GPU idle measured, and the draw code's key and bound state made pureView command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.