perf(vk): use temporary pipelines for required draws by default #1643
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!1643
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:perf/required-draw-quick-default"
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: CachyOS Linux, GeForce RTX 3090 · Needs: Windows Intel, Mesa RADV
TL;DR
A graphics draw that needs an unfinished pipeline can now try a temporary one by default while the optimized build finishes. The game reached Link’s house with the default enabled. A separate cold-driver test found a small median improvement. The effect on gameplay stutter is still unconfirmed.
Breakdown
Why
Required draws can block a frame when the driver has yet to compile the pipeline. Giving that draw a usable pipeline earlier can shorten the wait.
What changed
The default for
RX_VK_QUICK_MSisrequired. A positive numeric budget also permits temporary builds for skippable draws. Zero disables the feature. Native RADV mesh draws keep their optimized shaders on a cache miss because unoptimized execution can reset the GPU. See #1000.The renderer checks whether the worker published the pipeline during a cache lookup before starting a duplicate compile. Temporary builds try Intel’s compiler lock without waiting behind the worker.
Measurements
Verdict: The temporary pipeline served 19 of 24 cold requests first in a synthetic RTX 3090 test. Median time to a usable pipeline changed from 8.83 to 8.55 ms. Only one control request exceeded 16.7 ms.
Hardware: RTX 3090, NVIDIA 620.70.06, CachyOS Linux, Ryzen 9 7900X, 32 GB RAM.
Scene: A game-free Vulkan test using twelve synthetic fragment shaders and a fullscreen vertex shader.
Method: Two runs per mode, in off/required/required/off order. Time from worker dispatch to the first usable pipeline handle, median of 24 requests per mode.
How to reproduce: Race the temporary pipeline against an optimized build for each synthetic shader using a new application pipeline cache and a fresh driver cache per run. Check the cold lookup before timing each request.
Baseline: Both columns use the explicit settings on 7850a7cb. The final default on this PR was checked separately in the game.
Flags and settings
The existing switch gains a required-draw mode and selects it by default.
RX_VK_QUICK_MSrequired0to opt out.Testing
Tested: The final Linux renderer built and passed its symbol check. With the flag unset, the game reached Link’s house and completed the item setup on an RTX 3090. Its log selected required-only mode and recorded cached pipelines serving waiting draws. The quick-pipeline regression passed with GCC and Clang. The draw side-effect and Intel compiler gate tests passed.
Not tested: Displayed-frame pacing or a cold gameplay comparison on this revision. The full suite was not rerun. The switch-table test reports the same nine unrelated failures on the PR and the base commit.
Must be tested:
Risks
Drivers may serialize the two builds internally. The temporary pipeline can compile slowly, use more GPU time, and consume additional memory until shutdown. Existing strict-wait mode still permits requiring the full pipeline for every draw.
Compatibility: The renderer reads the new default at launch. Existing numeric overrides still apply.
Checklist
Everyone
type(scope): description) of the status line's type.can't be run by hand is in Testing's Not testable by hand, with why.
in Risks. Extra compiler work and retained memory are documented, but their in-game cost has not been measured.
main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named). Focused tests ran. The full suite was not rerun.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.Possibly related, for context:
Final Linux smoke test on an RTX 3090 with NVIDIA 620.70.06: the game reached Link’s house and finished item setup in 7,166 headless frames. With RX_VK_QUICK_MS unset, the renderer selected required-only mode and reported at least 200 cached pipelines serving waiting draws. Cold gameplay pacing remains unverified.