fix(agc): select the first level of a single-level depth view #11098
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11098"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by edubox on 2026-10-25T17:30:48Z.
What
decodeDepththrew whenDB_DEPTH_VIEW.MIPIDselected a level above zero on a surface whoseDB_Z_INFO.MAXMIPis zero. Flashback (PPSA08546) reaches that state:DB_Z_INFOis0xa0000181(128x128 D16 Z_X with HTILE,MAXMIP0) andDB_DEPTH_VIEWselects mips 1 to 6 over six slices while its colour target hasMAXMIP7. The depth allocation is six 64 KiB slices: the next allocation starts 0x61000 bytes later, too small for a mip tail, and every view uses the same base and extent, so the field has no other depth level to select. The driver now decodes the first level instead of throwing.The
agc_driver_graphicscase that expected "on a surface without mips" now checks that the decoded address and extent are level 0's. The same line is edited by #10435, which keeps that throw for PS4 depth targets; either order needs a rebase from one of us (Depends onisnonebecause #10435 is CONFLICTING). The console behaviour of the ignored view mip is recorded in the libSceAgcDriver debt file and is not measured.Tested
CachyOS Linux 7.3.0-3-cachyos, GCC 16.2.1, Release with
BUILD_TESTING=ON.agc_driver_graphicspasses on the change and on currentmain(4718dedcf8) withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, on both the AMD Radeon Graphics (RADV RAPHAEL_MENDOCINO, Mesa 26.2.5-arch3.1) and the NVIDIA GeForce RTX 4080 SUPER (615.78.08). Neither log reportswas not found but was requested by env var VK_INSTANCE_LAYERSor aVUID-error.python3 tools/check_conventions.py --base origin/mainpasses.Flashback (PPSA08546) on the AMD iGPU: on the build before the branch switch, with a temporary switch selecting level 0 in the same decode branch, the title passed the cubemap mip pass at about 35 s and ran to 150 s, where the unpatched build aborts at about 115 s with
[videoout] presentation failed: AGC graphics: depth view mip 1 on a surface without mips; dumped frames after the pass show the scene. The shader-cache version changed with currentmain, so the runs made from this branch spent their 150 s compiling/streaming and did not reach the pass yet; the decode path is the same. The console was not measured.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T17:32:19Z.
Review: APPROVED
Reviewed the single-level depth-view fallback and the regression assertion. With
MAXMIP == 0, selecting level zero keeps the same base address and extent; the existing level-selection path is unchanged for mipmapped surfaces. The PR records the specific Flashback allocation evidence and leaves console equivalence unverified.The author reports
agc_driver_graphicson both main4718dedcf8and this head with the required validation-layer settings on the same two GPUs; those AGC files have no changes between that main commit and the current PR base2e1c72239b. Exact-head conventions, eligibility, intake, labels and report checks pass. #10435’s author confirmed either landing order and will rebase #10435 if this one lands first, so there is no unresolved dependency. Approved.Imported from boykopovar/AnyPS5. Originally posted by klosixgaming-arch on 2026-10-25T21:45:42Z.
Review: APPROVED
Reviewed head
f1fb9d6eafby reading the diff and the existing review thread. I did not build or run this, so everything below is from the code, not from a test of mine.What it does. For a depth target whose
DB_Z_INFO.MAXMIPis 0, a non-zeroDB_DEPTH_VIEW.MIPIDis ignored (viewMipis forced to 0) instead of failing with "depth view mip N on a surface without mips". ThemaxMip != 0path is untouched.Checked:
maxMipis now read beforeviewMip, the removedRequire(false, ...)is the only behavioural difference, and the diagnosticsnprintfbelow it only runs formaxMip != 0, so it cannot print a forced zero. The regression test changes the oldexpectFailureinto an assertion that address and extent equal the base level, which is the correct property for "selects the first level".Notes:
MIPID = 1. A second case withMIPID = 15would show the value is ignored rather than clamped.DB_DEPTH_VIEWon a mip-less surface is now accepted without a trace. A one-time log line would keep the tripwire. Optional.Approving.
AI-assisted: yes. Written with AI assistance and reviewed by me.