Repository navigation
fix(agc): treat a view past a depth surface's first level as memory - #5982
Merged
adriadam10 merged 1 commit intoOct 16, 2026
Merged
Conversation
11 tasks done
This was referenced Oct 14, 2026
milescoviello
force-pushed
the
fix/depth-surface-later-level
branch
from
October 15, 2026 02:57
8bcff0c to
ac816ca
Compare
milescoviello
force-pushed
the
fix/depth-surface-later-level
branch
from
October 15, 2026 08:59
ac816ca to
463ab14
Compare
milescoviello
force-pushed
the
fix/depth-surface-later-level
branch
from
October 15, 2026 09:39
463ab14 to
16e193a
Compare
This was referenced Oct 15, 2026
milescoviello
force-pushed
the
fix/depth-surface-later-level
branch
from
October 15, 2026 12:00
16e193a to
51a1871
Compare
This was referenced Oct 15, 2026
|
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.
|
This was referenced Oct 15, 2026
Closed
fix(agc): place device memory in host memory when the driver refuses a device-local allocation
#5987
Merged
milescoviello
force-pushed
the
fix/depth-surface-later-level
branch
from
October 15, 2026 13:00
51a1871 to
00e159d
Compare
11 tasks done
11 tasks done
A depth surface is one level: the driver rejects draws that render a depth mip. A sampled or storage view at the surface's address and extent that starts at a later level, or a storage access to a later level, does not touch that level, so it is not the depth plane. DepthSurfaceTexture and DepthSurfaceStorage still sent such views to the surface, which rejected the level. Forspoken (PPSA03984) builds a depth pyramid from its 1984x1116 D32 depth surface with a compute shader that samples one level of a five-level R32F view and stores the next, and stopped there. Both now leave such views to the texture and storage caches, as they already do for a view of another extent or format. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
milescoviello
force-pushed
the
fix/depth-surface-later-level
branch
from
October 15, 2026 16:56
00e159d to
92f170c
Compare
Collaborator
|
Checked on main + this PR: |
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
Forspoken (PPSA03984) builds a depth pyramid from its 1984x1116
D32_SFLOAT_S8_UINTdepth surface: a compute shader samples one level of a five-level R32F view at the surface's address and stores the next. It stops at the first sample:A depth surface is one level here, because the driver rejects draws that render a depth mip (
DB_DEPTH_VIEW MIP_LEVEL). A view at the surface's address and extent that starts at a later level does not read or write that level, so it is not the depth plane: what it reaches was written by other GPU work or the CPU.DepthSurfaceTextureandDepthSurfaceStoragesent such views to the surface anyway, and the surface rejected the level. They now return no surface for a sampled or storage view that starts past the first level, or a storage access to a later level. The texture and storage caches then read it from memory, as they already do for a view of another extent or format. The level check inRequireStorablecan no longer fail and is removed.A view that starts at the first level and also covers later levels is unchanged: it still includes the depth plane, and sampling it is still rejected.
agc_driver_graphicsgains a five-level R32F view of a D32 surface's own extent: its first level must still sample the depth plane, and a view of level 1 must be read as memory. Inagc_driver_depth_storage, a storage access to level 1 and a storage and a sampled view of level 1 must leave the depth surface alone. The storage check there expected "not implemented" before. Withmain'sDepthSurface.cppthe graphics test stops with the "levels 1-1" error above and the storage test with "storage image access to level 1 of the depth plane".Tested
Ubuntu 24.04, GCC 13.3 (CI's compiler), Release with CI's configure flags, on
mained835aa, RTX 4070 Ti with NVIDIA 595.99.02:libSceAgcDriverpass.agc_driver_stencil_ref_exportis skipped because the device lacksVK_EXT_shader_stencil_export, andagc_host_import_sparseandagc_driver_sparse_dma_buf_importbecause/dev/udmabufis not accessible here.--to-inteland run on Linux under a 15 GiB memory cap, measured onmain4d5411d. All builds carry fix(agc): accept a copy's sample selection on a draw that copies nothing #5937, perf(shader): avoid redundancy traversal map copies #5511 and fix(agc): copy an indirect draw's vertex buffer only up to its last element #5975, which the title needs to get this far, start from the same filled shader cache and differ only inlibSceAgcDriver.prx:vkAllocateMemoryruns out of device memory for a storage texture.storage image access to level 1 of the depth plane of depth surface 0xa22af20000 is not implemented.tools/check_conventions.py --base upstream/mainpasses, andtools/pr_overlap.py --branchfinds no overlap.PPSA03984-app0) on currentmain8856f18, 1920x1080, pad input, one run each:mainstops at 22 s on theDB_RENDER_CONTROLcheck (fix(agc): accept a copy's sample selection on a draw that copies nothing #5937); with fix(agc): accept a copy's sample selection on a draw that copies nothing #5937 it stops at 61 s on the indirect vertex buffer read (fix(agc): copy an indirect draw's vertex buffer only up to its last element #5975); with fix(agc): accept a copy's sample selection on a draw that copies nothing #5937 and fix(agc): copy an indirect draw's vertex buffer only up to its last element #5975 at 116 s on the depth pyramid view (fix(agc): treat a view past a depth surface's first level as memory #5982); with all three it draws an in-game scene by 60 s (the lower half still black, about 4 FPS) and runs to 195 s, wherevkAllocateMemoryfor a render target fails withVK_ERROR_OUT_OF_DEVICE_MEMORYon the 12 GB RTX 4070 Ti. The memory goes to retired depth surfaces that are never freed. With fix(agc): free retired depth surfaces nobody samples #6465 added as well, it reaches a 600 s limit (onmain0c4816f).Not checked on Windows or on a console.
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)🤖 Generated with Claude Code