Repository navigation
feat(agc): render PS4 color views of several slices through the vertex render target index - #26040
puridanish284 wants to merge 1 commit into
Conversation
…x render target index A single-sample CB_COLOR_VIEW of several slices with PA_CL_VS_OUT_CNTL USE_VTX_RENDER_TARGET_INDX now decodes as a layered view of the array at CB_COLOR_BASE and draws through its resident array image, each layer placed with its own GCN bank rotation. Multisampled views still throw. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The reviewed code supports the described single-sample layered GCN color view behavior, and I found no verified blocking defect.
What I ran
Reviewed head 25063d71f6897d5d73d23ee1dccc2e2f2848509c. I did not run commands or tests; reported test results below are author-reported. Read Draw.cpp, State.cpp, the new GcnLayeredColorTarget.cpp, the changed portions of Graphics.cpp, the debt fragment, and the prepared description, commit list, manifest, and diff. Graphics.cpp was read through the pinned reader although its full text was excluded from the bundle. No files were excluded from the review.
Results
| Check | Result | Note |
|---|---|---|
| Code review | passed | No verified blocking defect |
| Focused tests | not run | Author reports 6/6 passed |
| Console behavior | not run | Debt fragment says not checked |
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not execute the reported tests or check behavior on a physical console. The prepared bundle marked Graphics.cpp as too large for inclusion; its changed section was read through the pinned reader.
To get this to a good state
Nothing is required.
|
@puridanish284, the change is contained and well tested on the recompiler side: it only turns a multi-slice single-sample GCN color view with PA_CL_VS_OUT_CNTL bit 18 into a layered target (no new Vulkan or recompiler code, no new capability requirement), everything else decodes as before, and GcnLayeredColorTarget fails on main with the old refusal and passes on lavapipe with validation. Before this can pass I need evidence for what it now answers, because it replaces a refusal with a rendering:
I am not asking for code changes in the decode itself. |
|
NVIDIA run on Linux: the new Setup: RTX 3070 8 GB, NVIDIA 610.57.04, Ryzen 5 5600X, Debian 13 (kernel 6.12.115), GCC 13.3.0 Release, validation layer 1.4.335. Base is the merge-base 2c08875, head is 25063d7.
Every Vulkan test's log selects the RTX 3070 and shows the layer inserted, none reports it missing, and no log has a AI-assisted: yes |
|
Verified on real AMD RADV (Linux) across all three gens, complementing the lavapipe/WSL run in the PR and @Doorriiaann's NVIDIA run. Built the PR head (
All three print Evidence: VERIFIED (reproduced on each GPU under the above conditions). |
|
GPU run of head Code.
Negative control. I applied only this PR's GPU. I measured this head merged onto
No test skipped. Validation.
Host:
AI-assisted: yes |
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
@oneandonlydean, on your two points:
|
ligmaSec
left a comment
There was a problem hiding this comment.
The nonzero-first-slice fixture draws into two view-relative layers and checks that the intervening and outside slices retain their initial contents. That exercises both the array offset and per-layer bank rotation. The graphics test retains explicit refusal of a multisampled layered view. The posted environment lists Vulkan 1.4.318. Please confirm the Khronos validation layer version separately, since the loader or device API version does not identify it and this repo requires 1.4.335 or newer. The paired graphics run and new layered fixture are queued with layer 1.4.369.
AI-assisted: yes.
What
A PS4 (GCN)
CB_COLOR_VIEWcovering several slices (SLICE_MAXaboveSLICE_START) threwGCN layered rendering into several array slices through the vertex render target index is not implementedwhenPA_CL_VS_OUT_CNTL.USE_VTX_RENDER_TARGET_INDX(bit 18) was set. #20162 made such a view draw intoSLICE_STARTwhen the bit is clear. With the bit set, a single-sample view is now a layered target, the way the AGC path already draws one through the array's resident image:DecodeGcnColorBuffersetsarrayAddresstoCB_COLOR_BASE,arraySlicetoSLICE_START,arrayLastSlicetoSLICE_MAXandlayersto their span, so the vertex render target index counts fromSLICE_START.addressandbytesstill describe the first slice, as before.ArraySurfaceForTargetclearspipeBankXorfor GCN targets. The array image is then laid out as the texture path lays out a GCN 2D array, and each layer gets its own bank rotation (GcnLayerBankXor, feat(agc): draw into later slices of 2D-tiled PS4 color target arrays #18721) instead of the first slice's rotation applied to every layer.prepareDraw, the check that the array image's layer pitch equals the view's slice offset now takescolor.bytesas the slice size for GCN targets. The AGC formula assumes AGC tiling, which does not apply to GCN surfaces.A multisampled layered view still throws, with the message
GCN layered rendering into several slices of a multisampled color array through the vertex render target index is not implemented. A view of one slice, and a view without bit 18, decode exactly as onmain. A debt fragment updates thePS4 color array slicesentry (not checked on a console).Tests:
GcnLayeredColorTarget(agc_driver_gcn_layered_color_target): for thin 1D (tile index 13) and thin 2D (tile index 14) four-slice 128x64 RGBA8 arrays, it decodes a view of slices 1 to 3 with bit 18 set. It then draws a triangle with render target index 0 and another with index 2, each with its own color. Every texel is checked where the texture path places it: slices 1 and 3 hold the background or their own drawn color, the triangle covers between a quarter and three quarters of each, and slices 0 and 2 keep their background. The thin 2D case exercises the per-layer bank rotation.tests/Graphics.cppexpected the old refusal. It now checks that the view of slices 1 to 2 decodes as two layers of the array atCB_COLOR_BASE, and that a two-sample view is refused with the new message.Tested
WSL2 Ubuntu on Windows 11, Release build with GCC, lavapipe (Mesa 25.2.8). The same 6 focused tests (
agc_driver_gcn_layered_color_target,agc_driver_gcn_color_array_slices,agc_driver_gcn_color_view_slice_range,agc_gcn_color_target,agc_driver_array_layer_target,agc_driver_array_layer_target_cpu) were run withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_DEBUG=layerandctest -R <pattern> -V:main2c08875 (with the new test file added): 5/6 passed.agc_driver_gcn_layered_color_targetfails with the old refusal. 5Insert instance layer "VK_LAYER_KHRONOS_validation"lines, nowas not foundline, 15VUID-VkDeviceCreateInfo-pNext-pNext.was not foundline, 15VUID-VkDeviceCreateInfo-pNext-pNext.The only validation ID on both is the device-creation one from Ubuntu's older 1.3.275 layer (#17693). The change adds no new
VUID-. All 19 ctest tests matchinggcn, andagc_driver_graphics, pass on this PR. No title was run.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)tools/pr_overlap.py --branchreports file-level overlaps only, with no shared exports. #25684 edits nearby lines ofDecodeGcnColorBuffer(theCB_COLOR_INFOcheck andSLICE_STARTdecode); whichever merges second keeps both sides.🤖 Generated with Claude Code