perf(vk): defer speculative pipeline probes when a draw needs its shader #1564
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1564
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:perf/defer-shader-prewarm-until-draw"
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 Performance · Risk Medium · Tested on Linux, Ryzen 9 7900X, GeForce RTX 3090, NVIDIA 620.70.06
Summary
When a draw needs a shader whose background load is unfinished, let the loader finish the shader records and defer speculative graphics pipeline probes. When a draw first requests a deferred state, it probes the cache for that exact pipeline. A cache miss follows the existing build path.
Why
A headed Market playtest recorded 45.9 ms in shader program handling on a 74.9 ms renderer frame. The draw was waiting for a load that could also prepare graphics states for future draws.
What changed
The worker checks for demand before reading each matching pipeline note and again before entering the driver. A driver call already in progress finishes. The renderer remembers deferred keys in its existing pipeline table. An already prepared handle takes precedence. Program and shader-cache layouts are preserved.
This PR contains only the shader change and its regression test. It can be reviewed independently of #1553.
Measurements
The Linux headed integration build deferred 49 probes and loaded the existing shader cache. During 29 seconds of settled Market gameplay it averaged 60.5 FPS with a 25.6 ms p99 and a 32.5 ms worst present. Field averaged 60.6 FPS with a 41.4 ms p99 over 45 seconds. Scene-entry stalls remained. These are observations from one manual pass. A same-route before-and-after comparison with populated pipeline notes remains outstanding.
Testing
The game-free fixture on the #1553 base showed that a draw running its own shader load also probed optional pipelines. It passes with this change, including the worker already in a driver probe, a draw arriving during a note read, publication of multiple program keys, and ordinary background prewarm. The headed game ran the same shader change alongside #1553. The standalone main-based tip is pending its own in-game smoke and full suite.
Risk and rollback
The first use of a deferred state may still incur a cache probe. The default renderer path handles absent pipelines. Compute program loads keep their existing behavior. Reverting the change restores eager graphics probes.
Checklist
Tested in game: Linux, GeForce RTX 3090, NVIDIA 620.70.06. Headed Market and Hyrule Field on the #1553 integration with this shader change. Existing pipeline notes loaded and 49 speculative probes deferred. The standalone tip's own smoke is pending.
WIP: perf(vk): defer speculative pipeline probes when a draw needs its shaderto perf(vk): defer speculative pipeline probes when a draw needs its shaderPost-merge verification of the exact PR head
0a3486a689on Linux and RTX 3090: the standalone build completed the 25-second Market movement check and deferred 64 graphics pipeline probes with existing notes loaded. The queue detected an outside build, so this run verifies execution only. Full suite: 710 passed, 45 failed, 19 skipped. All 45 failures reproduced on the exact main base1a29134d10. The shader-load regression passed.