fix(agc): build pipeline library shader parts for the draw's depth format #4363
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4363"
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 johnmaia on 2026-10-12T07:42:23Z.
What
LinkPipelineFromLibrariesbuilt the pre-rasterization and fragment shader libraries with an emptyVkPipelineRenderingCreateInfo, so those parts hadVK_FORMAT_UNDEFINEDdepth and stencil even when the fragment output library and the draw had a depth target. On RADV a pipeline fast-linked from such parts hangs the GPU at its first draw (ring gfx_0.0.0 timeout, no page fault).The shader parts now get the draw's view mask and depth and stencil formats, and those three values join their cache key. Color formats stay out of it, so fragment shader parts are still shared across color target formats.
Rebased on #4152: the attachment key is combined with each part's own layout key. Shader parts that #4152 prebuilds at registration have no depth target, so a draw with a depth target builds its own.
Tested
Linux, RX 7600 (RADV NAVI33, Mesa 25.2.8).
agc_driver_recorder_tests --pipeline-library-onlygets a check that a depth target builds new pre-rasterization and fragment shader parts. It fails on main ("a depth target shared the shader libraries built with no depth format") and passes with this change. The fullagc_driver_recorder_testsrun and allagcctests (434) pass after the rebase one7c70a2df; the pipeline-library tests also pass withAPS5_NO_PIPELINE_LTO=1.RADV_DEBUG=syncshadersAPS5_NO_GPL=1APS5_NO_PIPELINE_LTO=1(fast-linked pipelines only)APS5_NO_PIPELINE_LTO=1+ this changeBisecting the fast-link-only run by shader hash found several independent culprits (depth-only shadow and G-buffer pipelines); all had a depth target.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T07:43:34Z.
The conventions checks fail for five findings: the PR template sections
What,Tested, andChecklistare not recognized because the body does not use the required###headings, and the two new inline comments inPipelineLibrary.cppviolate the repository comment rule (comments must document technical debt indocs/dev/TechnicalDebt.md). Could you use the template headings and either move the implementation rationale to the PR description or document actual remaining debt in that file? Please also includeDepends on: none(or the relevant PR) andAI-assisted: yesin the checklist.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T08:07:00Z.
The current conventions check is failing on two removable source comments at
PipelineLibrary.cpp:138–139(comments must be limited to technical debt, or removed) and the PR body is missing the requiredWhat,Tested, andChecklistsections. The other reported checks are passing. Please update those items and rerun conventions.Imported from boykopovar/AnyPS5. Originally posted by kr4y4 on 2026-10-12T18:51:00Z.
Windows run on NVIDIA and Intel, since the description's run was on RADV.
Setup: Windows 11 (26200), WinLibs GCC 15.2.0 r7, Release, CI configure flags, an RTX 4070 Laptop GPU and an Intel Raptor Lake-S iGPU, both with graphics pipeline libraries. The head
0b46084c9merged intomain2a5eca11c.agc_pipeline_library,agc_pipeline_library_off,agc_pipeline_library_fast_only,agc_pipeline_cacheandagc_driver_graphicspass on both GPUs with--repeat until-fail:3. The three pipeline-library tests also pass three times each withAPS5_NO_PIPELINE_LTO=1.main'sPipelineLibrary.cppand the new check,agc_pipeline_libraryfails on both GPUs:a depth target shared the shader libraries built with no depth format.ctest --timeout 120 --parallel 4): 973 of 973 on the RTX 4070. On the iGPU 972 of 973; the one failure,agc_driver_f32_dot2_rounding, fails the same way onmain(noshaderFloat64, #4528).agc_driver_recorder_tests --pipeline-library-onlylogs nothing on either GPU, with this change or withmain'sPipelineLibrary.cpp. Withmain's file, the draw with the depth target links before the check fails, so the layer doesn't flag shader parts built with no depth format. Neither GPU hung.Written with AI assistance.