fix(agc): render all attachment layers with dynamic rendering #3763
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3763"
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 eljackjoestar-cmd on 2026-10-11T16:33:12Z.
What
With #1077's layered-target support, dynamic rendering must use the validated attachment layer count rather than one. Set
VkRenderingInfoKHR::layerCounttostate.renderLayers, matching the conventional framebuffer path.Validate nonzero layers and
maxFramebufferLayersbefore the dynamic-rendering constructor return. Retain main's nonlayered array-view admission and limit the array bit-18 rejection to non-3D targets. The mesh validation fixture uses the device target's subgroup size.This branch carries #1077's authored implementation and layered-volume fixtures. Rebased onto main
4bb2c7f3947440d513b1dbd12143ec55b250495a, which includes merged #423. Both old copied #423 commits (995b8ee5a/21122721c, later745dbf031/3bb16903d) are dropped from the topic history. The draw and preparation paths retain main'sPositionExportLayoutand add the routed layer bits at use. Clip/cull validation and its tests are retained from main.Request serialization writes version 21 and continues reading version 20's position export field at its original boundary. Tests cover version 20, older vertex captures, and combined clip-distance/layer bits. #4451 also proposes version 21; whichever merges second must renumber.
Dependencies and merge order
#423 is merged. This branch carries #1077 rather than requiring its separate merge. The agreed sequencing with #4715 remains: #423 and #4584, then #4715, then this branch. The #4715 ordering is separate from the runtime layer-count correction. Combined validation with #4715 is not claimed here.
Tested
Final head
dedb869fa2e860903d0403d8edff42211305c51f. Windows 11 x64, Ryzen 7 7800X3D, 32 GiB RAM, RTX 5070 (device subgroup size 32), WinLibs GCC 15.2, Release,BUILD_TESTING=ON.Full Windows Release build passes. Ten focused tests pass without skips in 7.03 s:
agc_shader_memoryagc_driver_graphicsagc_driver_layered_volume_drawagc_driver_layered_volume_submitagc_driver_layered_volume_vertexagc_driver_layered_volume_vertex_no_gplagc_driver_vertex_clip_cull_distancesagc_driver_vertex_clip_cull_drawagc_driver_vertex_clip_cull_draw_no_keyagc_vertex_layer_exportThe framebuffer regression rejects zero and excessive layer counts for both dynamic and conventional constructor paths, and accepts the dynamic path's limit boundary. Layered vertex readbacks check every channel of four slices, including routed bands and the untouched slice outside the view. The mesh case validates shader metadata on the physical subgroup size; it does not perform mesh pixel readback. Driver submission checks ordinary, uncompressed-DCC and fast-clear-DCC rendering. Its fixture now calls #423's explicit driver shutdown on success and exception paths: the first test run completed all readback checks but crashed at teardown without that call; the final run above exits cleanly.
Conventions and whitespace checks pass. Earlier title tests used a broader Lost Soul Aside PPSA26358 integration; this update does not claim a fresh game run, full-suite/CI success or complete playability.
Checklist
Imported from boykopovar/AnyPS5. Originally posted by GustavoGamarra95 on 2026-10-11T19:48:47Z.
This also fixes Beast of Reincarnation (PPSA29343, Unreal Engine). It builds its 32x32x32 color-grading LUT (an A2B10G10R10 3D color target) with one draw of 32 instances whose vertex program picks the layer (
PA_CL_VS_OUT_CNTLbit 18). WithlayerCountat 1 only slice 0 was written, holding the last instance; the tonemapper then mapped dark colors to white and bright ones to black, and the title screen showed a luminance negative. With the same one-line change on my branch the title screen renders as on the console.Measured on Linux:
agc_driver_layered_volume_drawandagc_driver_layered_volume_submitfailed on an RTX 3050 Laptop (NVIDIA 615.78.08) and on lavapipe with "slice 1 ... another layer's band", and pass with the change (vertex case). A Radeon 660M (RADV) passed both before and after. On the RTX 3050 the mesh case of the draw test still fails with "missing or incompatible shader execution mode" and the submit test segfaults at exit; both also happen without the change.We are still analyzing the remaining rendering issues of this title and an improvement for GPUs with little VRAM.
Imported from boykopovar/AnyPS5. Originally posted by johnmaia on 2026-10-12T11:54:15Z.
Tested with Epic Mickey: Rebrushed (PPSA15657, Unreal Engine) on Linux, RX 7600 (RADV NAVI33, Mesa 25.2.8).
mainthe title stops at the start of the first level with "color views of several array slices are unsupported" (#2102).Imported from boykopovar/AnyPS5. Originally posted by queeeef on 2026-10-12T19:22:45Z.
Palworld (PPSA23126) needs this. On an RTX 2080 Ti (NVIDIA 610.74), graphics pipeline libraries are available, so draws take the dynamic rendering path.
The title makes three layered draws (
PA_CL_VS_OUT_CNTL0x01240000, the render target index through the misc vector):A2B10G10R10, one color targetR16G16B16A16_SFLOAT, two color targetsDB_DEPTH_VIEWslices 0..5With #1077 merged locally but
layerCountstill 1, only slice 0 of the LUT and of the volume was written. Every frame goes through the LUT, so the whole world rendered dark and grey, with odd tints and almost no colour.With
layerCountset from the framebuffer's layer count, as here, and nothing else changed, the same scene has normal colours: blue sky and distant terrain through an archway, warm torch light on the stone, skin and hair in the right tones.The depth-only cube draw is not covered by this PR or #1077: layered rendering with a depth target is not implemented, so its six faces still land in one slice.
Setup: Windows 11 Pro 26300, RTX 2080 Ti (NVIDIA 610.74), MinGW-w64 GCC 15.2.0,
main5d933db02with #1077 and the open PRs the title needs (#2648), local change equivalent to this PR'slayerCount.AI-assisted (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-13T00:50:18Z.
Current serialization coordination with #4451: #3763 is merged and establishes canonical request 21. Our corrected head 0bcf45842, pinned to main
075169f7b3faeae1216efc35df41c44fac9f3190, writes format 22 for the added pixel dither flag. It preserves the primitive reader at >=19 and vertexpaClVsOutCntlreader at >=20. Twelve original main-4bb version-20 requests and twelve independently emitted/round-tripped main-075 version-21 requests establish the compact compatibility bodies; these twelve pairs differ only at the version byte. Both canonical versions, nonzero vertex controls, trailing fields and upgrade identity are checked. The dither gate lowered to21 or20 and vertex gate raised to21 each produce the expected serializer failure; exact restoration/rebuild and compatibility x20 pass. Full NVIDIA: 1054 passed / 0 failed / 8 skipped of 1062, maximum 24.0818 s; current AMD limitations remain in #4451/#4768. This tests the corrected alpha branch on the merged canonical layout, not compatibility with other unmerged proposals. No new title/console or full upstream-CI claim. AI-assisted: Codex.Historical audit: #3763 head53dae55 and the old #4451 headffd987b both used19 for different vertex/pixel fields while main was16–18. Those fork layouts cannot be distinguished by their version alone; they are not canonical main19. No combined-head build/runtime or cross-deserialization test is claimed. AI-assisted: Codex.
Imported from boykopovar/AnyPS5. Originally posted by winstrex on 2026-10-13T01:14:33Z.
Windows + NVIDIA data point: Windows 11, WinLibs GCC 15.2.0, Release, RTX 5070 Ti (pipeline libraries, so draws take the dynamic-rendering path). Head
53dae55dcmerged ontomain758aca737(clean).Both titles make the same layered draw as in #2102: a 64x64x64 RGBA16F 3D target with DCC,
CB_COLOR_VIEW0x80000,PA_CL_VS_OUT_CNTL0x01240000.color views of several array slices are unsupported(the other 2 crash earlier in unrelated faults). With it, 2 of 4 runs reach the main menu and are still running there after 150 s with no error; the other 2 crash earlier in the title's Wwise thread, before the layered draw.storage image access to depth/stencil surface ... (storage=2112x1188 guest format=22 mip=0 dimension=1 tile=4)), and 1 ran to 75 s and then faulted in the title (write of 0x0 atapp.exe+0x37dd2b), cause not traced. Nothing new is visible before those stops (loading spinner, then black, as onmain).Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T08:27:00Z.
This goes in after #423, as the branch that carries #1077. Three things first:
995b8ee5a,21122721c). They are #423 at577b8d57; its head is now 66e1669c (PositionExportLayout, driver shutdown and the fragment push slot in its tests). At this headagc_driver_vertex_clip_cull_distancesfails on NVIDIA witha stage's push constants lie outside its push constant slot. Rebase onto #423 once it merges and take the next free request version then (#4451 also wants 20).Pipeline.cpp:77returns before themaxFramebufferLayerscheck at:84, so the dynamic-rendering path passesstate.renderLayersunchecked. Move the check above the return.State.cpp:1071brings back the throw for array views that #3633 removed. Keep main's array branch and limit its bit-18 check to targets that are not 3D.LayeredVolumeDraw.cpp:206needs the device's subgroup size; the mesh case fails on wave32 withmissing or incompatible shader execution mode.Imported from boykopovar/AnyPS5. Originally posted by eljackjoestar-cmd on 2026-10-13T08:31:43Z.
Rebased the branch and its declared dependency commits onto main
fc1f063f5, retaining their original authors. The conflict resolution preserves main’s multisampled-color tests, nonlayered array-range admission and invalid-range checks, while retaining the dependency’s layered 3D/DCC behavior. The dynamic-rendering layer count remainsstate.renderLayers.Full Windows Release build passes. All five focused tests pass without skips in 5.72 s: graphics, shader memory, vertex layer export, layered-volume vertex readback with pipeline libraries, and the same readback without them. The stale ordinary-array rejection assertion was corrected during validation. Conventions and whitespace checks pass. Existing dependency/merge-order declarations are retained. No new game run, full-suite success or combined #4715 validation is claimed.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T08:51:31Z.
Thanks. #423 is merged now, so please drop
745dbf031c9(the old #423 copy) and rebase onto main; it conflicts in 12 files because of it. Two points from before are still open on this head:Pipeline.cpp: themaxFramebufferLayerscheck comes after the early return, so the dynamic-rendering path passesstate.renderLayersunchecked. Move it above the return.LayeredVolumeDraw.cpp: use the device's subgroup size instead of 64; the mesh case fails on wave32.Main is at request version 20 now (#423), so this takes 21; #4451 also wants it, and whichever merges second renumbers.
Imported from boykopovar/AnyPS5. Originally posted by eljackjoestar-cmd on 2026-10-13T08:54:13Z.
Addressed the runtime and fixture corrections, and removed the copied #423 implementations from the public branch:
maxFramebufferLayersand the nonzero-layer check now run before the dynamic-rendering return. A regression covers zero, excessive and boundary layer counts.device.Target().subgroupSize; the full fixture now passes on this RTX 5070's subgroup size 32.The review fixes pass six focused tests on local validation stack
9ac0f638b(old dependency retained locally only), in 5.88 s. I also reproduced the old clip/cull fixture's push-slot failure; I am not claiming that dependency fixed.#423 remains open at
66e1669c. The cleaned branch explicitly waits for its merge, then needs the dependency/layout integration, the next free request version if required, and fresh builds/readbacks. No standalone-main or current-#423 combined validation is claimed for the cleaned branch. The description and dependency declarations now reflect that status.Imported from boykopovar/AnyPS5. Originally posted by eljackjoestar-cmd on 2026-10-13T09:09:09Z.
Rebased onto main
4bb2c7f39with merged #423; the new head isdedb869fa. Both old copied #423 commits, including745dbf031c9, are removed from the topic history. The integration retains main'sPositionExportLayoutand clip/cull handling, with the routed layer bits added at draw/preparation use.Both review points are now present on this head:
Pipeline.cpp:76checks nonzero layers andmaxFramebufferLayersbefore the dynamic-rendering return at line 78. The regression covers zero, excessive and boundary counts.LayeredVolumeDraw.cpp:206usesdevice.Target().subgroupSize; the mesh metadata case passes on this RTX 5070's subgroup size 32.Main's ordinary-array branch is preserved, with the bit-18 rejection restricted to non-3D targets. Request serialization is version 21, retaining the version-20 read boundary and compatibility coverage. Agreed on #4451: whichever merges second must renumber.
Full Windows Release build passes. All ten focused tests pass without skips in 7.03 s: graphics, shader memory, vertex layer export, full layered-volume draw/mesh validation, driver submission, vertex readback with/without pipeline libraries, and all three merged clip/cull tests (distances, driver draw, driver draw without its key).
The new driver-submission run exposed a fixture teardown crash after its readbacks passed. Adding #423's explicit driver shutdown on success and exception paths fixes that exit; the final run above passes cleanly. Conventions and whitespace checks pass. The description now reflects validation against merged #423 rather than the old dependency stack. The existing #4715 merge-order agreement is retained; no combined #4715 build or new game run is claimed.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T09:24:20Z.
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.
main)core/libs/prx/libSceAgcDriver/tests/VertexLayerExport.cppcore/libs/prx/libSceAgcDriver/tests/execution/LayeredVolumeDraw.cppcore/libs/prx/libSceAgcDriver/tests/execution/LayeredVolumeSubmit.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppL147-148core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppL1829, L1835core/shader/recompiler/ControlFlow/src/RequestSerializer.cppL751, L782core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppL1829, L1835core/shader/recompiler/ControlFlow/src/RequestSerializer.cppL751, L782core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppL1829, L1835core/shader/recompiler/ControlFlow/src/RequestSerializer.cppL751, L782core/libs/prx/libSceAgcDriver/Graphics/src/State.cppL992-993