Skip to content

fix(libSceAgcDriver): draw a PS4 color view at its SLICE_START - #23

Open
DealPotato wants to merge 4 commits into
Get-fix:ps4/agc-gcnfrom
DealPotato:fix/gcn-color-view-slice
Open

DealPotato wants to merge 4 commits into
Get-fix:ps4/agc-gcnfrom
DealPotato:fix/gcn-color-view-slice

Conversation

@DealPotato

@DealPotato DealPotato commented Oct 26, 2026 •

Copy link
Copy Markdown

What

@Get-fix a small follow-up to boykopovar#9431, offered here because DecodeGcnColorBuffer only exists on this branch. It sits on 26d651d3e0, so ps4/agc-gcn can fast-forward to it. It also merges cleanly with @savvaniss's main merge in #22 (4e8243ac48) and with boykopovar#9891 (375f5630ba).

A GCN CB_COLOR_VIEW with a nonzero slice threw "GCN color array slices are not implemented". inFAMOUS Second Son (CUSA00004) draws into slices 1 and 2 of views of one slice (SLICE_START = SLICE_MAX), so it stopped there.

  • The target is now the 2D surface SLICE_START slices of SLICE_TILE_MAX's size past CB_COLOR_BASE, tiled like slice 0. That is where the GCN texture layout places array layer SLICE_START.
  • A slice range without the vertex render target index (PA_CL_VS_OUT_CNTL bit 18) also draws SLICE_START, because every primitive lands there.
  • These cases still throw:
    • a slice range written through the render target index;
    • reserved view bits;
    • a view that ends before it starts.
  • No bank rotation per array slice is applied in the 2D thin modes, which matches the texture layout. Neither is checked on a console. The new "PS4 color views" debt entry says so.
  • The second commit only removes the code comments of the first, which CONVENTIONS.md keeps to technical debt.

Tested

Windows 11 Pro 10.0.26300, WinLibs GCC 15.2.0 (MinGW-w64), Release. The runs were on 77bb7c2b5; the second commit removes only comments. They used ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (Vulkan SDK 1.4.363.0).

Checklist

  • Based on current main; no other open PR implements the same functions (based on ps4/agc-gcn, the head of feat(libSceAgcDriver): draw PS4 (GCN) command buffers boykopovar/AnyPS5#9431)
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • 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: CUSA00004 (inFAMOUS Second Son)
  • GPUs tested: NVIDIA GeForce RTX 4070, driver 610.88, Windows 11 Pro 10.0.26300
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

Get-fix and others added 4 commits October 22, 2026 12:19
PS4 color and depth targets, PS4 graphics EOP events, and the PS4 tile
modes (1D/2D thin and display, depth with tile split, PRT, linear
general) on the AGC executor, with a GPU detiler for every mode.
Textures sampled over the padded corner of a render target are GPU block
copies, and the PS4 SDK pattern-fill compute kernel runs as a GPU fill
when it repeats one dword, so render targets and HTILE are cleared
without a CPU drain. Two-dword patterns keep running the kernel: as
fills, Limbo's clears of its 64-bit target made its gameplay advance
about half as far per frame.
Tests cover the tiling equations against addrlib formulas, the GPU
detiler for every mode and element size, and the fill ranges.
…p test

The 4 KiB display buffer alignment check now names linear and PS4
buffers, because PS4 tiled display buffers may be 4 KiB aligned too.
video_out_flip_ps4 still looked for the old text when a PS4 buffer set
is changed to the PS5 tiled layout, so it failed although the change is
still refused.
A GCN CB_COLOR_VIEW with a nonzero slice threw "GCN color array slices
are not implemented". inFAMOUS Second Son (CUSA00004) draws into slices
1 and 2 of views of one slice (SLICE_START = SLICE_MAX).

The target is now the 2D surface SLICE_START slices of SLICE_TILE_MAX's
size past CB_COLOR_BASE, tiled as slice 0, which is where the GCN texture
layout places array layer SLICE_START. A slice range without the vertex
render target index (PA_CL_VS_OUT_CNTL bit 18) draws SLICE_START as well,
since every primitive lands there; a range written through that index
still throws, as do reserved view bits and a view that ends before it
starts. No bank rotation per array slice is applied in the 2D thin modes,
matching the texture layout; neither is checked on a console.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e change

CONVENTIONS.md keeps comments in code to technical debt; the debt entry
already describes the slice placement.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants