Skip to content

fix(agc): render layered mesh targets within device limits - #6959

Open
JJenkx wants to merge 6 commits into
boykopovar:mainfrom
JJenkx:fix/mesh-layer-windows-main2fab
Open

JJenkx wants to merge 6 commits into
boykopovar:mainfrom
JJenkx:fix/mesh-layer-windows-main2fab

Conversation

@JJenkx

@JJenkx JJenkx commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What

Override 2 (PPSA01907, #6933) renders its color-grading LUT through a 32-layer mesh draw. The RX 6650 XT reports maxMeshOutputLayers = 8; native readback found only slices 0–7 populated. Vulkan defines Layer output at or above this limit as undefined.

Render supported layered mesh color draws through attachment windows within the device limit. Rebase the mesh Layer output, cull primitives outside each window, and restore the original layer number for fragment ancillary input. Keep the late specialization values through shader preparation and distinguish them in both monolithic and graphics pipeline library caches. Persist the replay proof and window state in their cache/journal formats.

Replay excludes guest writes/atomics, clocks, GDS and unproven side effects. Read-only address loads are allowed: ResourceTracker sets usesDma for those too; bdaWrites and operation metadata distinguish writes. Empty direct draws preserve their no-op behavior. Existing refusals for layered depth and 2D array views remain. Wider framebuffer support and non-replayable shaders need a separate mesh-output capture path.

Depends on #6934, included as the first commit. The remaining five commits are this topic; the branch is linear on main b39d90bf14a43809e47c2c82b649467a64182afb. Published head 739cad5365da6743a7b546978afc12cdc94615dc. The production branch excludes the native readback instrumentation and the unrelated API fixes described below.

Overlap review: the required tool and shared changes were inspected. Debt appends and shader-cache version bumps are independent coordination. #6639 changes State/journal size/version constants; retain both codecs and recalculate the combined size/version after either merges. #5500’s physical view base is independent of this host window offset. #6379 strips unused layer interfaces; exported layer windows must retain theirs. #6683 changes SampleID in the shared builtin block; retain both branches. #6924 persists specialized modules; its disk codec must preserve this PR’s retained specialization vector when combining them. These are not implementations of device-limit layer windows and are not build prerequisites. Review details.

Tested

Latest refresh: six commits rebased linearly onto main b39d90bf14a43809e47c2c82b649467a64182afb; head 739cad5365da6743a7b546978afc12cdc94615dc. Retained the expanded upstream guest-load debt entry and this PR’s separate NGG entry. Main now uses shader-cache format 37, so this PR advances it to 38 for the additional serialized layer-replay proof; the pipeline-journal codec remains version 4 versus main’s 3. Release driver/recompiler and ten focused executables build. All 14 focused RADV checks pass, zero skips, 8.50 s, with Vulkan required, core validation and shader cache disabled: zero validation-error/VUID lines. Conventions and whitespace pass. No fresh title, full-suite, Windows or performance result is claimed. Pinned report, focused checks.

Previous refresh on main 5229: rebased all six commits linearly onto main 5229b5b829881ab3cef400aa351db197aec032c3; head 2bfd54a18c0a9728050873279cd61c244603157b. The conflict was limited to independent additions in docs/dev/debt/shader.md; both entries are retained and production patches are unchanged. Release driver/recompiler and ten focused test executables build. All 14 focused RADV checks pass with Vulkan required, core validation and shader cache disabled: zero skips and zero validation-error/VUID lines. Conventions and whitespace pass. No fresh title, full-suite, Windows or performance result is claimed. Pinned report, focused checks.

Previous refresh on main bd585: head b88367cad364a6b55b9fb641ecd186fd534ca87d is rebased onto main bd5856170891c2a148a384eb79b90fe8e9385bb6 without merge commits. The same #6934 prerequisite remains included; production patches are unchanged. The upstream thick-volume regression and both additive debt entries are retained. Release driver/recompiler and ten focused executables build. All 14 focused checks pass on RX 6650 XT / RADV Mesa 26.2.4-arch1.1 with core validation and Vulkan required, shader cache disabled: zero skips, zero validation errors/VUIDs, 10.38 s. These cover replay safety, disk cache, graphics, mesh, array layers, layered-volume draw/submit and explicit mesh/vertex execution, stencil replay, both journals and replay requests. Conventions and whitespace pass. No fresh title, full-suite, Windows or performance result is claimed. Pinned report, focused checks.

Arch Linux x86-64, GCC Release, Ryzen 9 7950X; AMD Radeon RX 6650 XT, RADV Mesa 26.2.4-arch1.1. Main’s published dependency pins.

Earlier refresh on main e9a: rebased without merge commits onto e9a3343a2, retaining the included #6934 prerequisite. The full default build passes. RADV: 626/630 pass, three skip, and only agc_driver_tessellation segfaults (the previously reproduced base failure, related #5444). The nine focused checks pass with core validation, no skips (7.42 s); all 14 memory/loader/voice checks pass, including the recent main changes. Conventions and whitespace pass. Current-head report, graphics/shader run, focused run, memory/loader run.

The detailed matrix, negative, lavapipe and native results below are from the earlier source revisions explicitly identified in their reports.

  • Full libs and the selected test executables build. Final CTest: 9/9 pass, zero skips, 7.39 s: replay safety, shader disk cache, graphics, mesh, array-layer control, volume vertex/compile control, explicit volume mesh execution, and both pipeline journal checks.
  • The GPU fixture uses a 99×16×34 RGBA8 volume, 33 visible layers starting at slice 1, distinct bands and unchanged regions checked at every RGBA byte. It covers a one-layer final window, fragment reads of the original layer number, and empty draws without replay certification.
  • Explicit mesh execution passes all four combinations of GPL on/off and synchronous/normal recording configuration with Vulkan required, shader cache off and Khronos core validation: zero validation errors/VUIDs. Maintenance9 compatibility warnings remain; the legacy render-pass path also warns about Layer output on the single-layer final framebuffer.
  • Production-only negative: disable the window dispatch, keeping the shader changes and exact regression executable. agc_driver_layered_volume_mesh fails at physical slice 9 / guest layer 8, retaining initial 64 instead of expected 255. The executable SHA-256 remains 652a5433d1cd3d6ab9302a96df2455638ea8506997e416d92135bec8eb0c144a. Restore/rebuild: final matrix and nine checks pass.
  • The new proof regression accepts read-only address access and rejects address stores, write metadata, buffer stores, GDS and clocks. Shader-cache round trips preserve the proof; the existing shared-SPIR-V storage check passes.
  • Local lavapipe: three vertex/compilation controls pass; the separate mesh execution test explicitly skips because its eight-lane subgroup lacks the current wave64 mapping. No software mesh execution pass is claimed. Prior attempts to execute that unsupported layout aborted, which is why compilation and execution are separate checks.
  • Conventions and whitespace pass. No Windows execution or full CTest suite claim from our local runs; independent NVIDIA evidence is attributed below. Hosted full builds need maintainer dispatch; skipped jobs are not passes.

Production report, final tests, negative control.

Native integration: d26ec82000b567763b3cee09905d8c27846273ac on main 2fab88d10, with #6934, #6913, peer #862 (lvmino97) and #6781 (XairRrR), plus diagnostic readbacks. The first candidate refused read-only address access and exited 134; the correction above is included here. All 181 captured title shader requests then recompile with the corrected classification. This is shader coverage for one title, not 181 title tests.

Two corrected runs finish with ordinary close / exit 0: full-volume diagnostic 182.08 s, normal rendering 93.58 s. The diagnostic LUT fills 8/16/24/32 slices and preserves earlier windows’ bytes. The normal menu shows the colored robot, signs, lamps and floor reflections. Both runs have zero core-validation errors/VUIDs and restore the temporary kernel limit. No native process remains.

The title integration contains the separately listed fixes; it is not unmodified main plus only this PR. The earlier screenshot uses a different base and animation phase. No gameplay, audio-quality, console comparison or FPS-gain claim. Native report, bring-up #6933.

Normal menu after the layer-window correction

Additional historical regression audit on head e8fabf090: the full default build passes. The broader RADV graphics/shader run selects 630 tests: 626 pass, 3 skip, 1 segfaults (agc_driver_tessellation). Rebuilding the unchanged main base bc3c0fc13 reproduces that segfault with the identical fixture and environment; its cause is not established by this comparison. Presentation tests and agc_driver_lds_atomics64 were excluded. After restoring the production head, the full build and the nine focused checks pass again (9/9, no skips, 7.66 s). The candidate backtrace enters libvulkan_radeon.so during GPL linking; related Mesa report: #5444. The installed driver has not been patched in this audit. This is not a claim that the entire suite is green. Machine-readable audit, broad run, unchanged-main control, restored focused checks.

Earlier main-e9 native repeat: clean integration 9a294a6bc on e9a3343a2 adds the same #6913/#862/#6781 prerequisites, without readback instrumentation. Eleven integration checks pass. A new empty AnyPS5 shader cache run shows the corrected menu and reaches Select Mech through controller input. Planned close: exit 0 at 303.55 s; zero core-validation errors/VUIDs; kernel limit restored and process gone. Gameplay/Training remain unverified, and the title is slow (observed title-bar samples 2.29–4.30 FPS, not a matched trace). No performance-gain claim. Current native evidence and limits; screens and current bring-up status.

Independent NVIDIA coverage: jotitadev reports tests of published head 5f4891387 merged onto main 47a266cf9, on Ubuntu 26.04 with GeForce RTX 3070 driver 595.99.02. The 650-test AGC run passes; the unmodified 33-layer fixture fits the reported 2048-layer limit and therefore does not exercise multiple windows on this GPU. With the production limit locally capped at 8, mesh execution passes 3/3; additionally forcing the window base to zero fails 3/3 at slice 9. This is reviewer-provided cross-vendor evidence, not a run performed on our machine. Their lavapipe run skips mesh execution; no NVIDIA title or Windows run is claimed. The existing fixture exercises multiple windows on the tested RADV limit of 8; automatic coverage on devices with larger limits remains a test limitation.

Independent second-title coverage: Pacuka reports The Smurfs - Dreams (PPSA21607) on RX 6650 XT (maxMeshOutputLayers = 8), RADV Mesa 26.2.4, CachyOS, Release, with a fresh save each run. Main e5f18ea99 has a black 3D menu background and an almost-black village. Main plus this PR head 739cad536 restores the menu clouds and removes the black village areas, but leaves washed-out colours; adding #6948 (56d7ebe41) gives the reported correct colours with no other patches. The commenter attributes that separate correction to storing a 1×1 readback image before a label. Both PRs applied cleanly and the game closed without a crash. Light ground-shadow flicker remains reported; its cause and relationship to performance are not established. This is contributor-provided title evidence, not our local run or a new performance claim. Their report is AI-assisted (Claude Code).

AMD Windows compatibility: thuanquang reports that the published 739cad536 head merged onto main 05171bc66 crashes in amdvlk64.dll during agc_driver_layered_volume_mesh on RX 6700 XT / Windows 11 / driver 32.0.21045.5002. #7674 keeps Layer output through a per-primitive Block struct and fixes that driver crash in their combined tests (3/3). It is a platform dependency for this PR, not included in this branch. Composition must retain this PR’s window-relative selected Layer store through #7674’s member-0 access chain in EmitMeshEntryPoint. #6379’s removal of Layer output cannot replace this dependency because it discards the layer routing required by the windows. No Windows title result is claimed.

Local composition check: RX 6650 XT / RADV, published #6959 head 739cad536 plus #7674 a9cd39045 and the already-merged #7374 commit 8f03282f5 (needed because this older base refuses last-provoking-vertex geometry): all seven focused tests pass three consecutive runs each, 21 executions, zero skips or core-validation errors/VUIDs, 5.92 s. Checks: mesh, array-layer target, volume draw/vertex/mesh, mesh provoking layer and mesh provoking vertex. Temporary combined head cf3579829d; this is compatibility evidence on the declared integration, not a rebase onto latest main or a Windows execution. The source branch published by this PR is unchanged.

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 under Silent stubs in their library's technical debt file
  • 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: fix(agc): transition resident attachment subresources #6934 (included); fix(shader): write a mesh shader's layer through a per-primitive block #7674 for AMD Windows mesh Layer output (not included)
  • Fixes: none
  • Unblocks: PPSA01907 Override 2: Super Mech League (PPSA01907) #6933 (LUT and menu-lighting correction in the declared integration)
  • GPUs tested: AMD Radeon RX 6650 XT, RADV Mesa 26.2.4-arch1.1, Arch Linux x86-64; local lavapipe Mesa 26.2.4 vertex/compile controls only, mesh execution skipped; reviewer-reported NVIDIA GeForce RTX 3070, 595.99.02, Ubuntu 26.04 (test coverage and local limit override detailed above)
  • AI-assisted: yes

@JJenkx

JJenkx commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor Author

Rebased cleanly onto current main e9a3343; published head 5f48913. Please dispatch the maintainer full Linux/Windows Build workflow for this head. The full local build passes, as do the nine focused RADV checks and all 14 memory/loader/voice checks. The broader suite remains 626 pass, three skip, and the independently reported Mesa tessellation SIGSEGV (#5444). Current reports are linked in Tested; the earlier matrix and title integrations retain their exact historical source limits.

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 4449 docs/dev/debt/libSceAgcDriver.md L188
PR 6612 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp L1968-1969
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp L38-39, L47
docs/dev/debt/shader.md L159
PR 6639 core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp L38, L47
PR 6679 docs/dev/debt/shader.md L159
PR 6762 core/shader/recompiler/StencilReplay.hpp L9
PR 7310 core/libs/prx/libSceAgcDriver/CMakeLists.txt L1972, L1975, L1979
core/libs/prx/libSceAgcDriver/tests/execution/LayeredVolumeDraw.cpp L273, L280
docs/dev/debt/libSceAgcDriver.md L188
PR 7445 core/libs/prx/libSceAgcDriver/Graphics/include/PipelineSpecialization.hpp L63-64, L67-69
core/shader/recompiler/PipelineSpecialization.hpp L32
core/shader/recompiler/Recompiler.cpp L667-668, L695
PR 7484 docs/dev/debt/shader.md L159
PR 7623 docs/dev/debt/shader.md L159
PR 7674 core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp L860-861

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1191 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 1341 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 2434 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 3247 core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/ShaderDiskCache.cpp
PR 4072 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/shader/recompiler/Recompiler.cpp
PR 4448 docs/dev/debt/libSceAgcDriver.md
PR 4650 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/PipelineSpecialization.hpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
docs/dev/debt/libSceAgcDriver.md
PR 4891 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/shader/recompiler/Recompiler.cpp
docs/dev/debt/shader.md
PR 5058 docs/dev/debt/libSceAgcDriver.md
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/shader/recompiler/PipelineSpecialization.hpp
docs/dev/debt/shader.md
PR 5426 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/shader.md
PR 5431 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 5441 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 5499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/debt/libSceAgcDriver.md
PR 5500 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/shader/recompiler/PipelineSpecialization.hpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
docs/dev/debt/shader.md
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/ShaderDiskCache.cpp
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/ShaderDiskCache.cpp
docs/dev/debt/libSceAgcDriver.md
PR 5941 docs/dev/debt/shader.md
PR 6009 docs/dev/debt/shader.md
PR 6044 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6177 core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
PR 6185 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6186 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/shader/recompiler/Recompiler.hpp
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6194 docs/dev/debt/libSceAgcDriver.md
PR 6215 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6218 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 6223 docs/dev/debt/libSceAgcDriver.md
PR 6234 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 6235 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
docs/dev/debt/shader.md
PR 6273 docs/dev/debt/libSceAgcDriver.md
PR 6280 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/PipelineSpecialization.hpp
core/shader/recompiler/ShaderDiskCache.cpp
docs/dev/debt/libSceAgcDriver.md
docs/dev/debt/shader.md
PR 6300 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 6312 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6320 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6360 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/ShaderDiskCache.cpp
docs/dev/debt/libSceAgcDriver.md
docs/dev/debt/shader.md
PR 6414 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6454 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.cpp
PR 6470 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
docs/dev/debt/libSceAgcDriver.md
docs/dev/debt/shader.md
PR 6472 docs/dev/debt/libSceAgcDriver.md
PR 6481 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 6486 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/ShaderDiskCache.cpp
PR 6488 core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.cpp
docs/dev/debt/shader.md
PR 6501 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6503 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
PR 6529 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6535 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
PR 6539 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/ShaderDiskCache.cpp
PR 6548 docs/dev/debt/libSceAgcDriver.md
PR 6549 docs/dev/debt/libSceAgcDriver.md
PR 6563 docs/dev/debt/libSceAgcDriver.md
PR 6606 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6613 docs/dev/debt/shader.md
PR 6615 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 6683 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6701 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6747 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6763 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6786 docs/dev/debt/libSceAgcDriver.md
PR 6788 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 6856 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6867 docs/dev/debt/libSceAgcDriver.md
PR 6868 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 6879 core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/ShaderDiskCache.cpp
PR 6937 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6941 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6946 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/ShaderDiskCache.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6947 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6963 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6970 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/ShaderDiskCache.cpp
PR 6977 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.cpp
docs/dev/debt/libSceAgcDriver.md
docs/dev/debt/shader.md
PR 6989 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/libSceAgcDriver.md
PR 6995 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/libSceAgcDriver.md
PR 7002 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/libSceAgcDriver.md
PR 7008 docs/dev/debt/libSceAgcDriver.md
PR 7085 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/PipelineSpecialization.hpp
core/shader/recompiler/ShaderDiskCache.cpp
docs/dev/debt/libSceAgcDriver.md
docs/dev/debt/shader.md
PR 7201 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
PR 7223 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.cpp
docs/dev/debt/shader.md
PR 7250 docs/dev/debt/libSceAgcDriver.md
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7258 docs/dev/debt/libSceAgcDriver.md
PR 7332 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
docs/dev/debt/libSceAgcDriver.md
docs/dev/debt/shader.md
PR 7388 docs/dev/debt/shader.md
PR 7390 core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7410 core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/StencilReplay.cpp
docs/dev/debt/shader.md
PR 7429 docs/dev/debt/shader.md
PR 7615 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/PipelineSpecialization.hpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7644 core/libs/prx/libSceAgcDriver/CMakeLists.txt

@jotitadev jotitadev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A run of the mesh execution test on NVIDIA. lavapipe skips it, and the description covers RADV.

Machine: Ubuntu 26.04, i7-8700, GCC 15.2, Release, BUILD_TESTING=ON. NVIDIA GeForce RTX 3070 (driver 595.99.02) and lavapipe (Mesa 26.0.3, LLVM 21.1.8) on the same host. Head 5f4891387 merged onto main 47a266cf9 (clean). ANYPS5_NO_SHADER_CACHE=1, -j1 --timeout 30.

Run RTX 3070 lavapipe
`agc_driver_layered_volume_(draw submit mesh
agc_driver_layered_volume_mesh, layer limit in Draw.cpp capped at 8 pass 3/3 not run
same cap, and window.meshLayerBase = 0u fails 3/3: mesh draw: slice 9 texel (0, 0) channel 0 is 255, expected 64 (another layer's band) not run
^agc (650 tests) 650/650 (main: 649/649) 650/650 (main: 649/649)

The 3070 reports maxMeshOutputLayers = 2048, so the unchanged test draws all 33 layers in one pass there. The window path is not used, and the pass on NVIDIA only shows that a large limit still works. To run the windows, I capped the limit at 8 in a local copy of Draw.cpp. With that cap the 33 layers are drawn in windows, and the test passes 3/3 on the 3070. With the cap and the window base forced to 0, it fails at slice 9, the same place as your production-only negative on RADV.

So the regression covers the window path only on drivers whose limit is below 33, such as RADV. lavapipe reports 9, but it skips mesh execution.

Not run: Windows, AMD, Intel, any title.

GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02) and lavapipe (Mesa 26.0.3), Ubuntu 26.04

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 17, 2026
@JJenkx
JJenkx force-pushed the fix/mesh-layer-windows-main2fab branch from 5f48913 to be5c05b Compare October 17, 2026 21:43
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 17, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 17, 2026
@JJenkx
JJenkx force-pushed the fix/mesh-layer-windows-main2fab branch from be5c05b to b88367c Compare October 17, 2026 23:37
@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Oct 18, 2026
@JJenkx
JJenkx force-pushed the fix/mesh-layer-windows-main2fab branch from b88367c to 2bfd54a Compare October 18, 2026 01:16
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 18, 2026
elliot1377 added a commit to elliot1377/AnyPS5 that referenced this pull request Oct 18, 2026
8237 and 8238 are taken by MeshLayerBase and MeshLayerCount in boykopovar#6959 and 8240 by DepthRemapBase in another open PR, so buildSpecializedModule would read a mesh module's IDs as workgroup offsets once both land.
@Pacuka

Pacuka commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Data point from the same GPU class, on a second title: The Smurfs - Dreams (PPSA21607, Unreal Engine). RX 6650 XT (maxMeshOutputLayers = 8), RADV Mesa 26.2.4, CachyOS, Release, fresh save each run.

Like Override 2, Smurfs builds its 32-layer colour-grading LUT with a single mesh draw, so on main only slices 0-7 get written.

build 3D menu background Smurfs' Village
main e5f18ea black almost black, only green foliage
main + this PR (739cad5) renders (clouds) no black areas any more, but washed out (near-white)
main + this PR + #6948 (56d7ebe) renders correct colours

The washed-out look in the second row is a separate bug (a 1x1 readback image that isn't stored before a label), fixed by #6948. With both PRs Smurfs looks right on this GPU, with no other patches. Both merged cleanly onto main e5f18ea. No crash, and the game exits cleanly. A light ground-shadow flicker shows up again in the village; I saw it before on other stacks, and it went away with faster runs (#4449), so I don't think it is related to this PR.

AI-assisted (Claude Code).

@JJenkx

JJenkx commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

Additional title validation: Crimson Spires (PPSA03568), RX 6650 XT / RADV NAVI23 (maxMeshOutputLayers = 8).

The title renders a 32×32×32 color-grading volume through a layered mesh draw. Before this change, compact image readbacks contained writes only in slices 0–7; the opening driving scene had a black sky and very dark road.

With the six commits through 739cad5365 cherry-picked onto the working Crimson integration (c4c2b3aa73 plus its existing depth-bounds/blend/image-usage prerequisites), the sky and road details become visible. This native comparison (f7f063a8e0) ran for 233 seconds, closed normally, and produced zero Vulkan validation errors. Shader/fragment/layer override diagnostics were disabled.

A separate compact readback run on that integration plus #6948 (0e7aa90000) confirms populated texels in all 32 slices in four captures; four other captures were entirely empty. That 82-second run also closed normally with zero validation errors. The extra visual benefit of #6948 in this title is not established.

This is a partial visual correction: the opening remains darker and less orange than the PS5 recording. No performance gain or complete graphics correctness is claimed. The standalone older PR base could not reach this scene without Crimson's integration prerequisites, so this is integration validation rather than a clean current-main comparison.

@thuanquang

Copy link
Copy Markdown
Contributor

An AMD Windows run, since the runs so far are RADV, NVIDIA and lavapipe. RX 6700 XT (gfx1031, RDNA 2), AMD's Windows driver 32.0.21045.5002, Windows 11 26200, WinLibs GCC 15.2.0 r7, Release, ANYPS5_REQUIRE_VULKAN=1. Build: main 05171bc66 with this PR's head 739cad536 merged (clean merge), SPIRV-Headers and SPIRV-Tools at their previous pin.

  • agc_driver_layered_volume_mesh crashes inside the driver when it draws through the mesh pipeline:
    graphics pipeline libraries: enabled
    FATAL: unhandled exception 0xc0000005 on thread 31012 ''
      rip 0x00007ffbf7343221 amdvlk64.dll+0x21f3221
      read of 0x0000000000000004
    
    agc_driver_mesh, agc_driver_array_layer_target, agc_driver_layered_volume_draw and agc_driver_layered_volume_vertex pass.
  • This is the driver crash fix(agc): drop layer I/O when linking mesh pipelines in driver to prevent AMD crash #6379 works around by dropping the mesh layer output: AMD's Windows driver crashes creating a pipeline whose mesh shader writes the per-primitive layer as a standalone PerPrimitiveEXT Layer array. Declaring the layer as a member of a per-primitive Block struct, the way glslang declares gl_Layer, avoids it and keeps the layer: fix(shader): write a mesh shader's layer through a per-primitive block #7674.
  • With that change on top of this PR (one textual conflict in EmitMeshEntryPoint: your OpStore of the windowed layer goes through the block's access chain), agc_driver_layered_volume_mesh passes 3 of 3, and so do agc_driver_mesh, agc_driver_array_layer_target, agc_driver_layered_volume_draw, agc_driver_layered_volume_vertex and fix(shader): write a mesh shader's layer through a per-primitive block #7674's agc_driver_mesh_provoking_layer.

So on this driver the layer windows need the block form, or a layer output that #6379 doesn't drop. I haven't run a title.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* build docs shader core/shader unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants