Repository navigation
fix(agc): render all attachment layers with dynamic rendering - #3763
oneandonlydean merged 12 commits into
Conversation
|
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 ( Measured on Linux: We are still analyzing the remaining rendering issues of this title and an improvement for GPUs with little VRAM. |
0fabfa8 to
69d11c8
Compare
|
Addressed the runtime and fixture corrections, and removed the copied #423 implementations from the public branch:
The review fixes pass six focused tests on local validation stack #423 remains open at |
A color view of several depth slices of a 3D target (CB_COLOR_VIEW SLICE_START < SLICE_MAX) was rejected as "color views of several array slices are unsupported". Titles render such volumes with one draw: an instanced draw whose vertex stage picks each primitive's slice through the misc position export (PA_CL_VS_OUT_CNTL USE_VTX_RENDER_TARGET_INDX with VS_OUT_MISC_VEC_ENA). Depends on boykopovar#423, which carries PA_CL_VS_OUT_CNTL to the recompiler. - DecodeColorBuffer takes the slice range of a 3D target (ColorTarget::layers, clamped to the surface's last slice), allows DCC on 3D targets, and sizes a tiled 3D target by its whole surface (SurfaceForTarget moves to State.cpp for that). DecodeState sets State::renderLayers and, for a layered draw, USE_VTX_RENDER_TARGET_INDX (State::layerExports); color targets of different slice counts and layered draws with a depth target throw. - The driver adds State::layerExports to the PA_CL_VS_OUT_CNTL bits boykopovar#423 passes (it already passes VS_OUT_MISC_VEC_ENA), so the render target index reaches gl_Layer only for layered draws and stays ignored elsewhere as before. - A vertex stage writing gl_Layer declares ShaderViewportIndexLayerEXT and SPV_EXT_shader_viewport_index_layer when the device offers them (the device enables VK_EXT_shader_viewport_index_layer when present), instead of SPIR-V 1.5 ShaderLayer, which a Vulkan 1.1 device cannot take. Graphics validation accepts the capability, the extension and a vertex Layer output when it is enabled, and a per-primitive Layer output of a mesh stage. - The resident target's attachment view is a 2D array view of the slices, and the framebuffer has that many layers (Framebuffer and AcquireFramebuffer take the layer count). The execution test agc_driver_layered_volume_draw draws three bands, one per layer, into slices 1..3 of a 4-slice 64 KiB-tiled volume and reads every slice back: slice 0 stays untouched and slice 1 + L holds only band L. It also recompiles a mesh program with the layer export and validates it against the layered state. The mesh case does not draw: lavapipe's LLVM backend aborts compiling that mesh pipeline ("Cannot emit physreg copy instruction"), which a test cannot catch. On RADV the same mesh draw renders the bands into the right slices. PPSA14632 (LEGO Horizon Adventures) renders its 64x64x64 RGBA16F translucency lighting volumes (two DCC targets, 64 instances) this way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main added the GPU-visible argument to GuestAllocations::Mutation::Add. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
agc_driver_layered_volume_submit submits a DCB whose context registers alone describe a 3D render target (CB_COLOR_ATTRIB3 resource type 3D, CB_COLOR_VIEW slices 1-3) and set PA_CL_VS_OUT_CNTL USE_VTX_RENDER_ TARGET_INDX, with both shaders registered before the draw. It checks that each band lands in its own slice. Removing the layer export from the vertex stage info in Driver::draw, or the bit-18 read in DecodeState, fails it. Two more runs draw the volume under DCC keys: uncompressed keys stay uncompressed, and 0000 fast-clear keys leave every texel the draw does not write at the clear color and end uncompressed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oute them The warning fired for every draw with PA_CL_VS_OUT_CNTL layer bits, including layered draws that now route the render target index. It is checked after the color targets are decoded and leaves out the routed bits and the misc vector enable. The comment that said layer exports are never routed is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
69d11c8 to
dedb869
Compare
|
Rebased onto main Both review points are now present on this head:
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. |
|
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.
|
Where upstream now does what this branch carried, upstream's version is kept: clip and cull distances (boykopovar#423), layered rendering (boykopovar#3763), block copies of BC textures over storage images (126a1e4), one-layer depth array storage views, joined and windowed host imports (importAccess). Kept from this branch on top: the retry of host imports refused while a heap was being committed, the shared registry lease, host-import reads of sampled textures (not for partially resident ones), the live storage image lookup for block copies, aligned buffer atomics, the CMASK reading of codes other than 0 and 15, mesh draws shorter than one primitive, and the relaxed float mode (request serialization version 24). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uzy15wqYTt6iWyxYXEzUWo
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