Skip to content

feat(agc): render PS4 color views of several slices through the vertex render target index - #26040

Open
puridanish284 wants to merge 1 commit into
boykopovar:mainfrom
puridanish284:claude/ps4-gcn-layered-color
Open

puridanish284 wants to merge 1 commit into
boykopovar:mainfrom
puridanish284:claude/ps4-gcn-layered-color

Conversation

@puridanish284

Copy link
Copy Markdown
Contributor

What

A PS4 (GCN) CB_COLOR_VIEW covering several slices (SLICE_MAX above SLICE_START) threw GCN layered rendering into several array slices through the vertex render target index is not implemented when PA_CL_VS_OUT_CNTL.USE_VTX_RENDER_TARGET_INDX (bit 18) was set. #20162 made such a view draw into SLICE_START when 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:

  • DecodeGcnColorBuffer sets arrayAddress to CB_COLOR_BASE, arraySlice to SLICE_START, arrayLastSlice to SLICE_MAX and layers to their span, so the vertex render target index counts from SLICE_START. address and bytes still describe the first slice, as before.
  • ArraySurfaceForTarget clears pipeBankXor for 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.
  • In prepareDraw, the check that the array image's layer pitch equals the view's slice offset now takes color.bytes as 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 on main. A debt fragment updates the PS4 color array slices entry (not checked on a console).

Tests:

  • New execution test 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.cpp expected the old refusal. It now checks that the view of slices 1 to 2 decodes as two layers of the array at CB_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 with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, VK_LOADER_DEBUG=layer and ctest -R <pattern> -V:

  • main 2c08875 (with the new test file added): 5/6 passed. agc_driver_gcn_layered_color_target fails with the old refusal. 5 Insert instance layer "VK_LAYER_KHRONOS_validation" lines, no was not found line, 15 VUID-VkDeviceCreateInfo-pNext-pNext.
  • This PR: 6/6 passed, 5 insert lines, no was not found line, 15 VUID-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 matching gcn, and agc_driver_graphics, pass on this PR. No title was run.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: lavapipe (Mesa 25.2.8 llvmpipe, Vulkan 1.4.318), WSL2 Ubuntu on Windows 11
  • AI-assisted: yes

tools/pr_overlap.py --branch reports file-level overlaps only, with no shared exports. #25684 edits nearby lines of DecodeGcnColorBuffer (the CB_COLOR_INFO check and SLICE_START decode); whichever merges second keeps both sides.

🤖 Generated with Claude Code

…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 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions github-actions Bot added docs agc libSceAgc* labels Nov 23, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

@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:

  1. There is no hardware oracle and no title run (the debt note says "not checked on a console"). Our rule for a throw that becomes an answer is one run of a title it fixes, or a hardware measurement. Please name a PPSA title that issues a multi-slice color view with a vertex render target index (cube map or shadow cascade rendered in one draw, stereo eyes) and show one run on this head, or add a tools/hw-oracle row for the slice selection.
  2. The slice an index selects (SLICE_START plus the index) and what GCN does when the index is past SLICE_MAX (clamp, wrap, or discard) are not established; the PR relies on the existing layered path. Please state which behaviour you tested or measured, and say so in the debt text if it is unmeasured.

I am not asking for code changes in the decode itself.

@Doorriiaann

Copy link
Copy Markdown
Contributor

NVIDIA run on Linux: the new agc_driver_gcn_layered_color_target passes and the array layer target and GCN color view tests do not regress.

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. ANYPS5_GPU=NVIDIA ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ctest -R '(array_layer_target|gcn_color|gcn_layered|agc_driver_graphics$)' -V, 3 runs each.

base this PR
agc_driver_gcn_layered_color_target (new) 3/3 pass
the other 6 matching tests 18/18 pass 18/18 pass

Every Vulkan test's log selects the RTX 3070 and shows the layer inserted, none reports it missing, and no log has a VUID- line.

AI-assisted: yes

@tablefrogpillow

Copy link
Copy Markdown
Contributor

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 (claude/ps4-gcn-layered-color) and ran agc_driver_gcn_layered_color_target under ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 with Khronos validation 1.4.363 inserted (confirmed Insert instance layer, no was not found):

GPU Arch Result VUID-
RX Vega 56 (RADV VEGA10, gfx900) GCN5 pass 0
RX 7900 GRE (RADV NAVI31, gfx1100) RDNA3 pass 0
Ryzen 7800X3D iGPU (RADV RAPHAEL, gfx1036) RDNA2 pass 0

All three print GCN layered color target tests passed (a view of slices 1–3 of a four-slice target) with zero VUID-. The PS4 color-view-of-slices / layered-target render path holds on real AMD across GCN5 and both RDNA gens.

Evidence: VERIFIED (reproduced on each GPU under the above conditions).
AI-assisted: yes

@Helldiverr

Copy link
Copy Markdown
Contributor

GPU run of head 25063d71f6 on RDNA4 with the AMD proprietary Windows driver and the Khronos validation layer: all focused tests pass in 3 of 3 runs with no validation errors. The existing runs were on NVIDIA, RADV and lavapipe, so this adds the first Windows AMD driver run. I found no new problem.

Code.

  • I read State.cpp:2464-2465 (layered and the multisample refusal), State.cpp:2488-2493 (array fields), State.cpp:2529 (pipeBankXor = 0 for the GCN array surface) and Draw.cpp:4078 (slice pitch from color.bytes for GCN). I have nothing to add to the review already on the PR.
  • The new test draws render target index 0 and 2 into a view of slices 1 to 3 (GcnLayeredColorTarget.cpp:56). On this host it reports that both land in slices 1 and 3 and that slices 0 and 2 keep their background, for Thin1D and Thin2D (6612 texels each). No test draws an index past SLICE_MAX, so this run does not answer oneandonlydean's question about that case.
  • py -3 tools/check_conventions.py --base upstream/main passes on the merge.

Negative control. I applied only this PR's tests/Graphics.cpp and tests/execution/GcnLayeredColorTarget.cpp onto main f5b7e1d1ac. Both agc_driver_gcn_layered_color_target and agc_driver_graphics fail with main's refusal: GCN layered rendering into several array slices through the vertex render target index is not implemented.

GPU. I measured this head merged onto main f5b7e1d1ac (clean merge):

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ctest --test-dir build -R "^(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|agc_driver_graphics)$" -V
test main head 1 head 2 head 3
agc_driver_gcn_layered_color_target not on main Passed 0.37 s Passed 0.25 s Passed 0.29 s
agc_driver_gcn_color_array_slices Passed 1.16 s Passed 0.31 s Passed 0.29 s Passed 0.32 s
agc_driver_gcn_color_view_slice_range Passed 0.94 s Passed 0.23 s Passed 0.22 s Passed 0.25 s
agc_driver_array_layer_target Passed 1.22 s Passed 0.44 s Passed 0.42 s Passed 0.45 s
agc_driver_array_layer_target_cpu Passed 0.46 s Passed 0.42 s Passed 0.40 s Passed 0.45 s
agc_driver_graphics Passed 12.29 s Passed 11.07 s Passed 11.23 s Passed 11.13 s
agc_gcn_color_target Passed 0.04 s Passed 0.03 s Passed 0.03 s Passed 0.03 s

No test skipped. agc_driver_graphics and agc_gcn_color_target open no Vulkan device, so they did not use the GPU. These are not performance measurements.

Validation.

  • Insert instance layer "VK_LAYER_KHRONOS_validation" lines:
    • main: 4, one each from agc_driver_array_layer_target, _cpu, agc_driver_gcn_color_array_slices and agc_driver_gcn_color_view_slice_range;
    • each head run: 5, the same four plus agc_driver_gcn_layered_color_target;
    • the negative control: 1.
  • No log contains was not found but was requested by env var VK_INSTANCE_LAYERS.
  • VUID- lines: 0 on main, 0 in the negative control and 0 in each head run.

Host:

  • GPU: AMD Radeon AI PRO R9700 (gfx1201, 1002:7551), driver 32.0.31044.16, Vulkan 1.4.349, reported subgroup size 64
  • Validation layer: Khronos validation layer 1.4.363 (LunarG SDK)
  • CPU: Ryzen 9 9950X3D
  • OS: Windows 11 Pro 26300
  • Toolchain: WinLibs GCC 15.2, Release
  • Commits: main f5b7e1d1ac, head 25063d71f6

AI-assisted: yes

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

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.

Pull request Shared files not compared
PR 1395 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 5925 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 6280 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6808 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7085 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7275 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 8246 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9356 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9387 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9508 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9712 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9852 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 9895 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9897 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9915 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10193 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10497 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 11452 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 11551 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 11825 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 13148 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 13809 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 13863 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 13920 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 13928 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 13929 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 14032 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 14473 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 14944 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 15343 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 15456 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 15548 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 15570 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 16879 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 16935 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 17022 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 17056 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 17611 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 17943 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 18029 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 20041 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 20518 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 20728 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 21923 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 22251 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 22328 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 22424 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 22434 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 22439 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 22647 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 22697 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 23252 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 23258 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 23281 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 23553 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 23811 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 24049 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 24083 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 24572 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 24735 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 24781 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 25489 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 26041 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 26084 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 27133 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 27807 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 28142 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28150 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 28176 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28193 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 28229 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28250 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28400 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28470 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 28487 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 28488 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28590 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28668 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28673 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 28808 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28920 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp

@nikmparis217-ux

Copy link
Copy Markdown
Contributor

@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:

1. There is no hardware oracle and no title run (the debt note says "not checked on a console"). Our rule for a throw that becomes an answer is one run of a title it fixes, or a hardware measurement. Please name a PPSA title that issues a multi-slice color view with a vertex render target index (cube map or shadow cascade rendered in one draw, stereo eyes) and show one run on this head, or add a tools/hw-oracle row for the slice selection.

2. The slice an index selects (SLICE_START plus the index) and what GCN does when the index is past SLICE_MAX (clamp, wrap, or discard) are not established; the PR relies on the existing layered path. Please state which behaviour you tested or measured, and say so in the debt text if it is unmeasured.

I am not asking for code changes in the decode itself.

@oneandonlydean, on your two points:

  1. Gran Turismo 7 (PS4, CUSA24767 01.71) issues such a view. DecodeGcnColorBuffer only runs for PS4 titles, so no PPSA title can reach it. On 22 Nov a local build of main with several open PRs (among them PR 22439, PS4 geometry shaders, which GT7 needs to get this far) stopped on GT7's brightness setting screen with GCN layered rendering into several array slices through the vertex render target index is not implemented. The next run added a local change with the same decode, array surface and slice size changes as this PR: GT7 went past that screen into PlayGo, the layered targets became resident arrays, and the run stopped later at an unrelated PS4 indirect draw. That run used my change, not this head: mine refused more than one fragment or FMASK, where this PR refuses more than one coverage sample. I can repeat it with this head.

  2. Not measured: I have no hardware measurement of the slice an index selects or of an index past SLICE_MAX, and I did not check the image in those slices. This PR's debt entry opens with "not checked on a console", and the Layered color targets entry it points to says the console's handling past SLICE_MAX is not modeled.

@ligmaSec ligmaSec left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants