fix(agc): wait for a compute dispatch instead of dropping it #25279
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/25279"
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 relativespace2K on 2026-11-21T20:48:57Z.
What
With
APS5_ASYNC_DRAW_COMPILE, a compute dispatch whose pipeline was building on the library prebuild pool returned without recording anything. A draw can be redrawn next frame; a compute dispatch cannot, and titles such as vkQuake build their BLAS with one-shot dispatches. Two wait points dropped it:skipping the dispatches of compute shader ... while its pipeline buildsand returned;InvocationForandMaterializeInBackgroundcould throwDrawCompilePending, which the dispatch path also swallowed.Compute dispatches now prepare synchronously, wait for the background materialization, and wait for their own library prebuild when their pipeline is queued or building. Draws keep the non-blocking path.
AsyncDrawCompilenow expects one dispatch with and without the environment.The prebuild wait is scoped to the dispatch:
SubmitComputePrebuildreturns the prebuild pool's sequence for the task,ResolvedDispatchcarries it from the resolve pass to the adopted dispatch, andAwaitComputePrebuildwaits only for that sequence. A large compute prebuild queued behind graphics library prebuilds no longer waits for the rest of the pool;AwaitLibraryPrebuildsremains only as the fallback when the pipeline was queued by another dispatch or the journal replay.agc_driver_compute_prebuild_sharecovers this: one blocked prebuild stays running while the await for another returns.Overlap: #25226 makes the same change from the other direction (a capped wait that leaves the build-ahead skip in place). This head stores the dispatch on the build-ahead path; maintainers can pick either.
Tested
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1.ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer:ctest -R '^(agc_driver_async_draw_compile|agc_driver_compute_prebuild_share)': 5/5 passed.agc_driver_async_draw_compile,_enabled,_small_pipelineand_disabled: 1 dispatch each.agc_driver_compute_prebuild_share: passed, including the new scoped-await case.Insert instance layer "VK_LAYER_KHRONOS_validation", none reports the layer missing, and none has aVUID-line.python tools/check_conventions.py --base origin/mainpasses.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositorySummary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T08:36:40Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the reviewed implementation and included tests support merging.
What I ran
Reviewed head
90b4e6620afb7fb7649fa5d74a066c9f0ee93cc2. No commands or tests were run;repo_read.pywas unavailable as a command interface, so I read the prepared review bundle and pinned repository through the review reader. The test results in the description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
No build, test, or convention check was run. I did not inspect repository behavior beyond the changed files and targeted pool callers. The author reports Linux/lavapipe and Windows/RX 6800 XT tests and a passing conventions check; these results were not independently verified.
To get this to a good state
Nothing is required.
Files read:
description.md,commits.md,manifest.json,diff.patch,Driver.hpp,ShaderRegistry.hpp,Dispatch.cpp,DrawCapture.cpp,ShaderRegistry.cpp,AsyncDrawCompile.cpp, andComputePrebuildShare.cpp. Excluded files: none; all seven changed files were included and read.Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-28T00:20:17Z.
Review: COMMENTED
Actionable comments posted: 3
4e1583a6-1456-4669-9b46-31ef5c11e816Reviewing files that changed from the base of the PR and between
750a5234edand8eb74c2335.core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Shaders/ShaderRegistry.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cppcore/libs/prx/libSceAgcDriver/tests/execution/ComputePrebuildShare.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-28T06:41:52Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected changes address the reported dropped compute dispatch and scoped prebuild wait; I could not run the checks in this review, so a formal approval is not justified.
What I ran
Reviewed head
1d7f05b094633202233debba84a5cf82e0322953using the prepared review bundle and pinned repository reader. No shell or test runner was available in this review session.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
Automated tests and convention checks were not run here. The Linux and Windows test results in the PR description are author-reported. I read the changed-line context in
Driver.hpp,ShaderRegistry.hpp,Dispatch.cpp,DrawCapture.cpp, andShaderRegistry.cpp, plus the full changedComputePrebuildShare.cpp. All six changed files are listed as included in the manifest; I did not read every line of the five source and header files.To get this to a good state
Nothing is required. The optional next step is to run the reported test and convention checks on this head.
Pull request closed