Repository navigation
fix(libSceAgcDriver): draw a PS4 color view at its SLICE_START - #23
Open
DealPotato wants to merge 4 commits into
Open
DealPotato wants to merge 4 commits into
DealPotato wants to merge 4 commits into
Conversation
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>
adriadam10
force-pushed
the
ps4/agc-gcn
branch
from
October 28, 2026 12:30
26d651d to
eefa508
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
@Get-fix a small follow-up to boykopovar#9431, offered here because
DecodeGcnColorBufferonly exists on this branch. It sits on26d651d3e0, sops4/agc-gcncan 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_VIEWwith 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.SLICE_STARTslices ofSLICE_TILE_MAX's size pastCB_COLOR_BASE, tiled like slice 0. That is where the GCN texture layout places array layerSLICE_START.PA_CL_VS_OUT_CNTLbit 18) also drawsSLICE_START, because every primitive lands there.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 usedANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation(Vulkan SDK 1.4.363.0).VUID-lines:agc_driver_graphics(newGcnColorViewSliceTests);agc_gcn_decodeandagc_driver_gcn_detile;agc_driver_color1555_targetandagc_driver_color565_target;video_out_flip_ps4, on a real display (-DANYPS5_VIDEO_OUT_TEST_DRIVER=windows).State.cppas on26d651d3e0,agc_driver_graphicsfails with "GCN color array slices are not implemented".tools/check_conventions.py --base 26d651d3e0: all checks pass.mainwith feat(libSceAgcDriver): draw PS4 (GCN) command buffers boykopovar/AnyPS5#9431, feat(libSceGnmDriver): build PS4 command buffers and submit them boykopovar/AnyPS5#9432, fix(shader): write a GCN v_cmpx result to its VCC or SDST as well as EXEC boykopovar/AnyPS5#9671, feat(shader): decode more GCN instructions and take a GCN image's dimension from its T# boykopovar/AnyPS5#9889, fix(agc): decode PS4 texture bases, linear-aligned targets and thin-tiled 3D textures boykopovar/AnyPS5#9891, feat(agc): write RELEASE_MEM DATA_SEL 4 for PS4 guests as an 800 MHz count boykopovar/AnyPS5#9893 and feat(savedata): add sceSaveDataMount2 boykopovar/AnyPS5#8285, Second Son gets past these draws. Its next stops (a UBNORM T#, thenPA_CL_CLIP_CNTLuser clip planes) are not related to this change.Checklist
main; no other open PR implements the same functions (based onps4/agc-gcn, the head of feat(libSceAgcDriver): draw PS4 (GCN) command buffers boykopovar/AnyPS5#9431)NotImplemented_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)🤖 Generated with Claude Code