Skip to content

fix(agc): build pipeline library shader parts for the draw's depth format - #4363

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
johnmaia:fix/gpl-shader-rendering
Oct 13, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
johnmaia:fix/gpl-shader-rendering

Conversation

@johnmaia

@johnmaia johnmaia commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What

LinkPipelineFromLibraries built the pre-rasterization and fragment shader libraries with an empty VkPipelineRenderingCreateInfo, so those parts had VK_FORMAT_UNDEFINED depth 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).

Run Result
default GPU hang at the first translucency lighting volume pass
RADV_DEBUG=syncshaders hang
APS5_NO_GPL=1 no hang
APS5_NO_PIPELINE_LTO=1 (fast-linked pipelines only) hang within seconds of boot
APS5_NO_PIPELINE_LTO=1 + this change no hang, 1,500 s, 3,584 lighting volume passes
default + this change no hang, 1,200 s, 2,617 lighting volume passes

Bisecting 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

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

🤖 Generated with Claude Code

@MarcZX10

Copy link
Copy Markdown
Contributor

The conventions checks fail for five findings: the PR template sections What, Tested, and Checklist are not recognized because the body does not use the required ### headings, and the two new inline comments in PipelineLibrary.cpp violate the repository comment rule (comments must document technical debt in docs/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 include Depends on: none (or the relevant PR) and AI-assisted: yes in the checklist.

@MarcZX10

Copy link
Copy Markdown
Contributor

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 required What, Tested, and Checklist sections. The other reported checks are passing. Please update those items and rerun conventions.

@github-actions github-actions Bot added the agc libSceAgc* label Oct 12, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 12, 2026
…rmat

The pre-rasterization and fragment shader libraries were created with an
empty VkPipelineRenderingCreateInfo, so their depth and stencil formats
were VK_FORMAT_UNDEFINED even when the output library had a depth target.
On RADV (RX 7600, Mesa 25.2.8) a fast-linked pipeline built that way hangs
the GPU at its first draw: Epic Mickey loses the device as soon as the
level renders its translucency lighting volume, and with
APS5_NO_PIPELINE_LTO=1 it hangs within seconds of boot. The shader parts
now get the view mask and depth/stencil formats of the draw, and those
formats join their cache key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kr4y4

kr4y4 commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

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 0b46084 merged into main 2a5eca1.

  • agc_pipeline_library, agc_pipeline_library_off, agc_pipeline_library_fast_only, agc_pipeline_cache and agc_driver_graphics pass on both GPUs with --repeat until-fail:3. The three pipeline-library tests also pass three times each with APS5_NO_PIPELINE_LTO=1.
  • With main's PipelineLibrary.cpp and the new check, agc_pipeline_library fails on both GPUs: a depth target shared the shader libraries built with no depth format.
  • Full suite (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 on main (no shaderFloat64, test(agc): skip the f32 dot2 rounding test on devices without shaderFloat64 #4528).
  • Under the Khronos validation layer 1.4.363 (errors and warnings), agc_driver_recorder_tests --pipeline-library-only logs nothing on either GPU, with this change or with main's PipelineLibrary.cpp. With main'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.

@oneandonlydean
oneandonlydean merged commit 7e2a2ae into boykopovar:main Oct 13, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants