fix(agc): render layered mesh targets within device limits #6959
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6959"
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 JJenkx on 2026-10-16T21:18:37Z.
What
Layered mesh targets can exceed the host's
maxMeshOutputLayers, corrupting volume-based rendering. Split the draw into supported layer windows while preserving guest layer numbering and fragment-layer inputs. Keep each specialized module alive through pipeline creation and distinguish the new window state in shader/pipeline caches.Rebased onto main
e67cc818696fafter #7310 landed. Both fixture extensions are retained: mip-target/direct-readback coverage from #7310, plus mesh execution and specialization-lifetime coverage here. The shared vertex fixture now allocates for all 33 layers, including the smaller mip cases. The branch contains 14 linear topic commits and no merge commits.Pipeline journal format is 15, separating the layered state layout from main's format 13 and #8212's format 14. The journal rejection test covers formats 12, 13 and 14. The shader disk cache remains version 51; #7223 also uses 51, so whichever merges second must reconcile that version.
Tested
Linux Release, bundled SPIRV-Tools enabled, AMD Radeon RX6650XT / RADV Mesa26.2.6-arch1.1 / Linux7.2.11-arch1-1. Pristine main
e67cc818696fd6e6c58ac80adc6550c54aed68e8and exact PR headf0bf17912ac43ad99cfa9f5aa121a70de5817e74were separately built and tested on the same machine:ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest -Vthroughout; actual layer insertion checked and no missing-layer diagnostic. Khronos1.4.363 at the recorded layer path.FileFormatis restored to 13: “a journal in previous format 13 was loaded”. Restoring 15 passes again. Formats 14, 13, 12, 10 and 2 are covered. No synthetic Vulkan success or GPU claim for this mock test.The format selection checked live source heads of 47 indexed PRs touching PipelineJournal.cpp plus file lists of 74 newer open PRs. Format14 is used by #8212; 15 was unused at that snapshot. This does not reserve a number against future changes.
Source/range diff, live format audit, verbose focused logs/JUnit, negative patch and restored results, SHA-256
89b2abb2111bc80e9bdf213eb5411da4f4eae90ab98fd57d5f4614991f61c46d. Archive downloaded back and all 25 internal file hashes verified.No new native title, Windows, NVIDIA, FPS or PS5 visual-equivalence result is claimed. Historical title evidence in the comments remains pinned to those older builds. Previous standalone qualification covers head950809624101, not this new head.
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)Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-16T21:24:24Z.
Rebased cleanly onto current main
e9a3343a2; published head 5f48913874ad06281354c190f47368ba93ead400. 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.Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-17T15:09:17Z.
Review: COMMENTED
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. Head5f4891387merged ontomain47a266cf9(clean).ANYPS5_NO_SHADER_CACHE=1,-j1 --timeout 30.agc_driver_layered_volume_mesh, layer limit inDraw.cppcapped at 8window.meshLayerBase = 0umesh draw: slice 9 texel (0, 0) channel 0 is 255, expected 64 (another layer's band)^agc(650 tests)main: 649/649)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 ofDraw.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.
Imported from boykopovar/AnyPS5. Originally posted by Pacuka on 2026-10-18T17:01:48Z.
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
mainonly slices 0-7 get written.maine5f18ea99main+ this PR (739cad536)main+ this PR + #6948 (56d7ebe41)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
maine5f18ea99. 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).
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-18T21:00:48Z.
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
739cad5365cherry-picked onto the working Crimson integration (c4c2b3aa73plus 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.
Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-18T21:35:48Z.
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:main05171bc66with this PR's head739cad536merged (clean merge), SPIRV-Headers and SPIRV-Tools at their previous pin.agc_driver_layered_volume_meshcrashes inside the driver when it draws through the mesh pipeline:agc_driver_mesh,agc_driver_array_layer_target,agc_driver_layered_volume_drawandagc_driver_layered_volume_vertexpass.PerPrimitiveEXTLayerarray. Declaring the layer as a member of a per-primitiveBlockstruct, the way glslang declaresgl_Layer, avoids it and keeps the layer: #7674.EmitMeshEntryPoint: yourOpStoreof the windowed layer goes through the block's access chain),agc_driver_layered_volume_meshpasses 3 of 3, and so doagc_driver_mesh,agc_driver_array_layer_target,agc_driver_layered_volume_draw,agc_driver_layered_volume_vertexand #7674'sagc_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.
Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-19T08:15:22Z.
Follow-up to my AMD Windows run, on the rebased head
2c8b8c87b(which now sits on top of #7674): RX 6700 XT (gfx1031), AMD driver 32.0.21045.5002, Windows 11 26200, merged ontomain7f596df48(clean). This driver reportsmaxMeshOutputLayers = 8, so the 33-layer fixture runs through several windows here.agc_driver_layered_volume_meshpasses 3 of 3 (it crashed inamdvlk64.dllbefore #7674), and so doagc_driver_mesh,agc_driver_array_layer_target,agc_driver_layered_volume_draw,agc_driver_layered_volume_vertexandagc_driver_mesh_provoking_layer.Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-20T00:54:25Z.
Additional native-title visual check: The Smurfs – Dreams (PPSA21607), content 01.002.000, on Arch Linux / GCC 16.2.1 / RX 6650 XT / RADV Mesa 26.2.4.
Compared the PR base
3aa35dc014a84b783c2fbe642f8e08341feb1a30against this PR's exact head7f39ff42fbe39b386a7c99633757dca2f1099be6. The title's Play/Options/Credits menu on main has a nearly black background; this branch renders the blue/purple sky, clouds and surrounding characters. Both use the same saved-game checkpoint and isolated empty shader/Mesa caches. Screenshots show the same menu scene at different elapsed times, so this is a rendering check, not a timing comparison.3aa35dcMain's screenshot is sync203 at actual 115 s; the PR screenshot is sync201 at actual 86 s. Runs finished by ordinary window close, with native launcher and supervisor exit 0, game PIDs gone and the temporary udmabuf limit restored to 64 MiB. Main and the PR both reached an opening cinematic image. Gameplay, audio correctness and functioning movie playback are not established: the candidate's 225 s and 285 s cinematic captures are identical. No performance improvement is claimed.
Evidence packet: exact commands, native reports, terminal results, screenshots and hashes. The extra sync202 control in the packet had an iconic window during its menu interval; its filenames 115/155 were captured at actual 212 s and must not be treated as menu-time evidence. The separate sync203 menu check above remained visible.
This supplements the already attached matched main/PR focused Vulkan validation; it does not replace it. No game assets, executables or saves are included.
Title tracking: https://github.com/boykopovar/AnyPS5/discussions/8158
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-20T15:11:06Z.
Additional title evidence: Tetris Effect: Connected (PPSA07923) on Linux, AMD Radeon RX 6650 XT / RADV. I independently reviewed the local Claude run reports, mapped driver paths, source composition and screenshots.
The same tutorial page (The Basics 1/12), captured at approximately 200 seconds, changes from almost black to legible text and a visible blue playfield when this PR is added:
c63824e66bcbc70851ac26eca8bb68f95fc7f868= main52f7807a554ec8c8169ea9c74d8dcd03195b3645plus the shader guard fix corresponding to #8518 and #8091.c6e5e5ab2aba0682e766c67c3772ec97fcc1dbf5, whose two parents are exactly the before pin and this PR head1dc700b0ce414d071f063e925af41a4cff0fce60. Both run reports record clean sources and the respective built driver mapping.Before:

After:

This is supplemental integration visual evidence, not a pure-main comparison or a performance benchmark. The dynamic board positions differ; complete title rendering correctness is not established. Both runs were deliberately terminated at their harness deadlines (
exit -15, approximately 454s / 253s); neither PID remains, but these runs do not establish ordinary-close behavior. They do not replace the focused validation results already reported for this PR.Evidence package: original screenshots, run reports, GPU selection excerpts and source-pin manifest. No game binaries, assets or saves are included.
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-20T16:07:25Z.
Rebased the seven topic commits onto main
4036fab1b2e77673c1b1a9a3ead97285c2254c62; new head79b802eba58a15b5473c8f36ca0422d2fe86917d. The additive shader-debt conflict preserves both entries. Range-diff confirms the source/test patches are unchanged. A local merge-tree check against newer main77e31219c8356c3f2265159e9fddac0d2e4d5a2eis clean.Matched focused validation on the same Linux / RX 6650 XT / RADV machine, with
ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, andVK_DRIVER_FILES=/usr/share/vulkan/icd.d/radeon_icd.json:agc_driver_layered_volume_(draw|submit)andagc_shader_disk_cache(_large_file): 4/4, each repeated three times.agc_driver_layered_volume_(mesh|vertex|vertex_no_gpl): 7/7, each repeated three times.VUID-messages, no missing validation-layer warning. The execution fixtures were enabled in both builds; the earlier stub-only attempt was excluded.agc_masked_selectand conventions checks pass.CTest used
-V --repeat until-fail:3 -j1. This refresh does not add a new title or performance claim. AI-assisted: yes.Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T10:56:54Z.
Current main advanced to pipeline journal format 6 with polygon-mode state in #7869 while the preceding paired validation was running. That creates a format-number collision with this PR’s distinct layered-window layout. I have rebased locally onto
275e896797and advanced the combined journal format to 7. Paired validation is now running again, including the new polygon-mode execution fixture on both main and candidate. Temporarily draft until those results are reviewed and the refreshed head is pushed; the previous 14/15-check evidence remains valid only for its explicitly stated revisions.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T11:01:02Z.
@JJenkx thanks for the rebase. We compared
dbd7f1167with the merge we had checked locally: the PR's patch is identical in all 18 files, and the emitter keeps both the Layer early return and main's SampleId-aware return.One thing changed under it: #7869 merged at 10:48 UTC and moved main's pipeline journal
FileFormatto 6, so this branch's 6 no longer marks the journals written before the layer-replay change. Please bump it to 7 (PipelineJournal.cpp:47). The branch compiles on current main andsizeof(State)stays 792 there, so the static_assert needs no change.Other open pull requests also bump this value, so whichever lands first takes 7 and the next one takes the value after it. We'll check again at merge time.
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-22T10:25:20Z.
Refreshed to ea89f74243086178db545be3063937310ace03f5: seven linear commits on main
cc0078595d, no merge commits. The Draw preparation/recording split is preserved; the layer-window wrapper is unchanged.Paired focused validation on RX 6650 XT / RADV passes 15/15 on main and 16/16 on the change, with Vulkan required, shader cache disabled and Khronos validation loaded for every GPU execution test; zero VUID errors or skips. Full libraries build on both. The description now links pinned logs and source review. A merge-tree check also passes against newer main
4777caca34, which was not the tested baseline. No new title or performance claim; draft state retained.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T16:51:29Z.
Review: CHANGES_REQUESTED
The coordination comments establish the order: on 25 October you agreed with #7310’s author that #7310 should land first, then #6959 will refresh while preserving both fixture extensions. The PR template still says
Depends on: none; #6934, #7674 and #7888 are merged into the base. Please update it to name #7310 as a merge-order-only dependency so the declared intake/order matches the agreement. I am not asking for a code change on this point.