Repository navigation
fix(agc): initialize stencil control and reference masks - #5347
Merged
oneandonlydean merged 1 commit intoOct 14, 2026
Merged
oneandonlydean merged 1 commit into
oneandonlydean merged 1 commit into
Conversation
This was referenced Oct 13, 2026
11 tasks done
RINNECODER
added a commit
to RINNECODER/AnyPS5
that referenced
this pull request
Oct 13, 2026
* perf(agc): fast-skip pure PM4 NOP packets during queue execution (cherry picked from commit 139bf04) Ported from upstream PR boykopovar#5481 * fix(agc): copy a shader, context or user config register to memory with COPY_DATA A dispatch now leaves its initiator and, for DISPATCH_DIRECT, its group counts in the shader registers, where the CP puts them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 5e36c08) Ported from upstream PR boykopovar#5477 * fix(agc): accept reported vertex stage state (cherry picked from commit 632331d) Ported from upstream PR boykopovar#4341 * fix(agc): initialize stencil control and reference masks (cherry picked from commit 85e0d98bba896002539365bb29a7a39a8e43f501) (cherry picked from commit 13dca48) Ported from upstream PR boykopovar#5347 * fix(agc): accept inactive vertex point size on non-point draws (cherry picked from commit d4b59ce) Ported from upstream PR boykopovar#4715 * fix(agc): treat type-0 texture descriptors as null (cherry picked from commit 7e1e1ce) Ported from upstream PR boykopovar#4779 * fix(agc): fall back out-of-range sceAgcInit versions to table 13 Pointer-shaped NID kW3GLb7QfPg calls from public homebrew succeed on console; returning an error left those titles failing init after boykopovar#4835. (cherry picked from commit 939f784) Ported from upstream PR boykopovar#5163 (debt-doc hunk dropped: file absent on main) * fix(agc): clamp sceAgcInit versions above 13 inline (cherry picked from commit 0cc5102) Ported from upstream PR boykopovar#5163 (second commit) * metal: adapt the shared AGC driver slice to the Metal execution loop - skip pure PM4 NOP packets in the Metal packet loop (upstream PR boykopovar#5481) - note the dispatch registers after direct and indirect Metal dispatch so COPY_DATA from a shader register works there (upstream PR boykopovar#5477) - NullImageDescriptor delegates to IsNullTextureResource (upstream PR boykopovar#4779) - tests: pm4 compute replay reads the dispatch initiator and group counts back through COPY_DATA; metal utility tests cover a type-0 image descriptor Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DgW4n3qYgi5jAAohEmXRQj --------- Co-authored-by: Kikoarl <7354010+Kikoarl@users.noreply.github.com> Co-authored-by: LeandroLP23 <leandroplacidi@gmail.com> Co-authored-by: MarcZX100 <marczxrr@gmail.com> Co-authored-by: MathiasDevelopes <25400788+MathiasDevelopes@users.noreply.github.com> Co-authored-by: lorkydey <57268822+Lorkydey@users.noreply.github.com> Co-authored-by: mazen <mazenshaar@hotmail.com> Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
(cherry picked from commit 85e0d98bba896002539365bb29a7a39a8e43f501)
Collaborator
|
Rebased onto main; no other change. Could someone with a title that sets stencil state through these registers run it on this head and post the result (title ID, GPU/OS, before/after)? It needs a run before it can go in. |
oneandonlydean
force-pushed
the
codex/pr-agc-stencil-clear-state
branch
from
October 14, 2026 05:02
d6b29fd to
8d89265
Compare
11 tasks done
12 tasks done
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
Initialize
DB_STENCIL_CONTROL,DB_STENCILREFMASKandDB_STENCILREFMASK_BF(context0x10b–0x10d) to zero on a new queue and afterCLEAR_STATE. Planet Coaster (PPSA01736 v01.017) enables stencil tests without writing the control register and stopped atmissing register in context bank at DWORD 0x10b (267).The values come from libSceAgc's public register-default tables V0, V4, V5 and V7–V11. Linux's GFX10 clear-state table agrees on the control register but differs on the reference masks; the source and unmeasured console reset behavior are recorded in technical debt. Missing registers elsewhere still throw.
Regressions cover unwritten front/back stencil state, explicit overrides, context reset and the PM4
CLEAR_STATEpacket. Both new regressions failed on unmodifiedmain, including the title's exact0x10berror.Overlap check: #4949 adds sample-location defaults to the same initializer at different lines, with tests elsewhere in
Graphics.cpp. No duplicate stencil-default fix was found.Tested
BUILD_TESTING=ON.main61b8742b6: builtagc_driver_graphics_testsandagc_driver_pm4_tests;ctest --test-dir build -R '^agc_driver_(graphics|pm4)$' --output-on-failurepassed (2/2; 0.11 s and 6.06 s). Subsequently rebased onto8cf6a0bc3; intervening upstream changes affect only the README and demo page. Conventions and whitespace checks passed after the rebase.libstarget was built on the combined bring-up branch. With the separate fiber stack-range fix also applied, Planet Coaster passes the missing-register failure, reaches the main menu and plays audio. The tester reports about 0.2 FPS, a black roller coaster and unresponsive input during the slowdown; an automated run also recorded a WatchDog illegal-instruction trap (0xc000001d,eboot.exe+0x2bf288). Title status: Game bring-up #5342. Full gameplay, Linux and other GPU vendors were not tested.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)