Repository navigation
Conversation
…ered attachments CB_COLOR_VIEW may select a range of slices; draws into a 3D color target then address the slice per primitive. The decoder rejected any view whose last slice differs from its first. A 3D target's view now carries the slice count, clamped to the surface depth, and the resident image's attachment view becomes a 2D array over those slices. The framebuffer takes the layer count, which every color target of the draw must share; a depth target alongside is still refused. Array targets keep the single-slice rule. PPSA15304 renders into a 48-slice 3D target with one draw.
For a draw into a color view of several slices, PA_CL_VS_OUT_CNTL reaches the vertex stage info (and the draw hash, the recompile cache key and the request serialization), so the render target index export becomes a gl_Layer output: per vertex, or per primitive in a mesh shader. SPIR-V targets below 1.5 take the vertex built-in from SPV_EXT_shader_viewport_index_layer; the device enables VK_EXT_shader_viewport_index_layer, the validation accepts both built-ins, and dynamic rendering begins with the framebuffer's layer count. Single-slice views keep ignoring the export, which lands on their slice as the hardware clamp would; the viewport index export stays ignored.
|
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.
|
|
Closing as a duplicate of #1077 (layered draws into 3D color targets, the render target index export routed to 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 |
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 fix(libSceAgcDriver): accept DCC on 3D color targets #4499 and feat(libSceAgcDriver): storage image access to depth surfaces #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