Repository navigation
fix(agc): accept a copy's sample selection on a draw that copies nothing - #5937
Conversation
|
I ran this PR's test on Linux. Setup: this PR's diff applied to main at 8cd937e (the PR's base is 421 commits behind it), default CMake build (CMAKE_BUILD_TYPE empty, unoptimized), clean environment.
So the new test catches the old behaviour here. I did not check Windows, macOS or a real GPU. Note: #5855 also edits Graphics/src/State.cpp and the same AI-assisted: yes |
802ff5d to
182b4c6
Compare
6e0f3cf to
573bf5a
Compare
|
Thanks. I reran the same Linux check on the current head 573bf5a, after the latest push. Its change has the same Setup: head 573bf5a merged into main at a08de68 (no conflicts; main has 14 commits that the head does not), default CMake build (CMAKE_BUILD_TYPE empty, unoptimized), clean environment (
So the result from my first run holds on this head. I did not check Windows, macOS or a real GPU. AI-assisted: yes |
573bf5a to
ac8914f
Compare
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
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.
|
ac8914f to
bb0dbe4
Compare
bb0dbe4 to
5ce989d
Compare
DB_RENDER_CONTROL.COPY_CENTROID and COPY_SAMPLE select the sample that DEPTH_COPY or STENCIL_COPY copies. Forspoken (PPSA03984) draws with DB_RENDER_CONTROL 0xc0, DEPTH_COMPRESS_DISABLE and COPY_CENTROID with neither copy bit set, and stopped at 43 s because both DepthMaintenanceRejection and decodeDepth took the selection for a copy. Accept the selection fields when no copy is enabled; draws that copy are still rejected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5ce989d to
4cdd2f4
Compare
|
Checked the |
|
Thanks for checking the masks. One thing that will hold up the Build: AI-assisted: yes |
|
An update for the Build: #6784 is in, so AI-assisted: yes |
|
Rechecked on current main 93e54ce: head merges cleanly, |
What
Forspoken (PPSA03984) stops 43 s after start on
main:0xc0isDEPTH_COMPRESS_DISABLE(bit 6) andCOPY_CENTROID(bit 7), withDEPTH_COPYandSTENCIL_COPY(bits 2 and 3) clear (Mesa's GFX10.3 register definitions).COPY_CENTROIDandCOPY_SAMPLE(bits 8–11) select the sample a depth or stencil copy reads; AMD's PAL sets them only together with a copy (gfx9DepthStencilView.cpp), and #5499 uses them that way to pick the copied sample. On a draw with neither copy bit set, nothing is copied and they have no effect.DepthMaintenanceRejectionanddecodeDepthboth rejected them as if they were a copy.Both checks now accept bits 7–11. A draw with
DEPTH_COPYorSTENCIL_COPYis still rejected, whatever sample it selects.depthMaintenanceTestsgains0x80,0xc0(Forspoken's value),0x100,0xf00and0x2fe3as ordinary controls, and keeps a copy with a sample selection (0x84,0x108,0xf88) as maintenance. The clear test decodes a combined depth and stencil clear with0xc0and with0xf00added and requires the same clear, and still rejects a clear with a copy and a sample selection. Onmain'sState.cppthe test stops at "ordinary depth controls were mistaken for maintenance"; with onlyDepthMaintenanceRejectionchanged it stops indecodeDepthon0xe3.Tested
Ubuntu 24.04, GCC 13.3 (CI's compiler), Release with CI's configure flags, on
maine34c479, 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. The two runs differ only inlibSceAgcDriver.prx;mainran first with an empty shader cache, this PR second with the entriesmain's run had written:main: stops at 43 s with the error above.DB_RENDER_CONTROLrejection; it was still running at 99 s, when it reached the 12 GB memory cap I set for the run. That is a separate problem: started from a filled shader cache,mainreaches a 15 GB cap within 10 s as well, and a jemalloc heap profile of that start puts most of the memory in SPIRV-Tools optimization.maina08de68 (default unoptimized build, mock Vulkan device):agc_driver_graphicspasses 3 of 3, and with onlyGraphics/src/State.cppput back tomainit fails 3 of 3 atordinary depth controls were mistaken for maintenance.DB_RENDER_CONTROLmasks against the GFX10.3 register layout (0x101cindecodeDepth,~0x2fe3inDepthMaintenanceRejection): copy and resummarize/decompress still throw, and a sample selection without a copy is ordinary.agc_driver_graphicspassed, and failed withmain'sState.cppatordinary depth controls were mistaken for maintenance.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