perf(agc): build large graphics pipelines in the background #19119
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19119"
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?
Imported from boykopovar/AnyPS5. Originally posted by Remi-Bon on 2026-11-12T19:57:40Z.
What
A cold graphics pipeline whose shaders are large blocks the draw while the driver compiles it; on Gran Turismo 7 (PPSA01317) each such pipeline takes 3.5 to 4.4 s on amdvlk, and the World Map and Garage freeze for minutes on a cold cache.
APS5_ASYNC_PIPELINE_WORDS=<n>(unset by default, so nothing changes without it):CachedPipelinecomputes, so the next draw of that configuration finds the pipeline resident;ClearCachedPipelineswaits for running builds before the device's pipelines are destroyed.#5925 builds the pipelines of a submission ahead of its draws, which still wait for them; this change skips the draw instead, and the two can be combined.
Skipped draws are missing from the frames rendered while their pipeline builds, which is the trade-off the variable opts into.
Tested
APS5_ASYNC_PIPELINE_WORDS=50000: no freeze at the title, World Map or Garage; 433 background builds of 3.5 to 4.4 s, 0 failures. Objects are missing until the queue drains. Without the variable the same scenes freeze for 8 to 25 minutes.APS5_ASYNC_PIPELINE_WORDS=200000: 8 builds, 1.6 s median, 0 failures.agc_pipeline_deferred_build: a cold configuration is skipped, its build becomes resident under the keyCachedPipelineuses even after the caller's programs and keys are freed, a second configuration is queued, andClearCachedPipelinesleaves no Vulkan object alive.agc_pipeline_store_*,agc_pipeline_journal*andagc_pipeline_library_clear_waits_for_buildpass.ctest --test-dir build -R 'agc_pipeline|agc_driver_pm4|agc_predication|agc_driver_pipelined_predica' -Vonmain(5634912b95) and on this branch, same machine and GPU, withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation(SDK 1.4.363.1, layer load confirmed withVK_LOADER_DEBUG=layer): 56/60 onmain, 57/61 here (the extra one isagc_pipeline_deferred_build); the same four tests are Not Run on both (agc_pipeline_link_optimization,agc_pipeline_queue_failure_wait|clear|stop, executables not built). Neither log hasVUID-or the layer-not-found message.tools/trace_digest.py: the change removes stalls rather than changing steady-state frame time.main(b99796f81b),agc_pipeline_deferred_build,agc_pipeline_store_*,agc_driver_pm4andagc_predication_testspass again under the same validation settings, with noVUID-.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code