feat(libSceAgcDriver): render color views of several 3D slices as layered attachments #4573
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4573"
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 ee6aba54 on 2026-10-12T16:00:06Z.
What
CB_COLOR_VIEWcan select a range of slices (SLICE_STARTtoSLICE_MAX); a draw into a 3D color target then addresses the slice per primitive through the render target index export. The decoder rejected every view whose last slice differs from its first ("color views of several array slices are unsupported"), and the index export was accepted but never routed.Two commits:
PA_CL_VS_OUT_CNTLreaches the vertex stage info (and the draw hash, the recompile cache key and the request serialization, now version 18), so the render target index export becomes agl_Layeroutput: per vertex, or per primitive in a mesh shader (the emitter already produced that output; the validation refused it). SPIR-V targets below 1.5 take the vertex built-in fromSPV_EXT_shader_viewport_index_layer; the device enablesVK_EXT_shader_viewport_index_layer, the validation accepts the vertex built-in with that capability orShaderLayerand the mesh built-in, and dynamic rendering begins with the framebuffer's layer count instead of 1. Single-slice views keep ignoring the export, which lands on their slice as the hardware clamp would; the viewport index export stays ignored and keeps its one-time log line.Tested
33ae282e4.ctestof a tree combining this branch with #4499 and #4500: 954 tests pass;video_out_flip_*andagc_driver_stencil_ref_exportare skipped on this machine.agc_vertex_layer_export(recompiler only) checks the SPIR-V 1.3 module takesgl_Layerfrom the extension without raising its version, the 1.5 module fromShaderLayer, and a misc vector export without the index declares no layer output. Newagc_driver_layer_export_slices(RTX 5080) draws into slices 0-3 of a 128x128x4 R32 volume with a vertex shader exporting slice 2 and reads every slice back: only slice 2 changes, also after the volume is written back to guest memory and uploaded again.agc_driver_graphicscovers the decode (slice range, clamping, inverted range) and the validation (the vertexLayerbuilt-in needs the device flag).agc_shader_memorypins the new serialization version.Layeroutput.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 github-actions[bot] on 2026-10-12T16:11:10Z.
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/Execution/src/Driver/Draw/Draw.cppL147core/libs/prx/libSceAgcDriver/Graphics/src/State.cppL996, L1009-1010core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppL147core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppL267core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hppL18, L50, L70, L126core/libs/prx/libSceAgcDriver/Graphics/include/State.hppL57core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppL163, L536core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppL740, L1968, L2156, L2532core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppL72, L84, L567, L582, L592, L605, L632core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cppL48, L130, L136-138, L145, L245, L566, L587core/libs/prx/libSceAgcDriver/Graphics/src/State.cppL100-102, L694-701, L972, L996, L1008-1014core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppL1329, L1335, L1342, L1345, L1348core/libs/prx/libSceAgcDriver/tests/Graphics.cppL1319, L3325-3329core/libs/prx/libSceAgcDriver/tests/VertexLayerExport.cppcore/shader/recompiler/ControlFlow/src/RequestSerializer.cppL404, L407, L423, L568core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cppL109-111core/libs/prx/libSceAgcDriver/tests/VertexLayerExport.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppL1640, L1645Imported from boykopovar/AnyPS5. Originally posted by ee6aba54 on 2026-10-12T16:23:00Z.
Closing as a duplicate of #1077 (layered draws into 3D color targets, the render target index export routed to
gl_Layer,VK_EXT_shader_viewport_index_layer) and #3763 (the dynamic rendering layer count). I missed both when I checked for overlapping pull requests.For those pull requests, in case it helps: PPSA15304 (engine: Unreal Engine 5) renders into a 48-slice 48x48x48 3D target with a mesh shader that exports the slice per primitive, so the per-primitive
Layeroutput of mesh shaders matters there as well as the vertex one. With an equivalent change, #4500 and #4586, the title reaches its main menu.Pull request closed