Skip to content

fix(agc): handle Demon's Souls read-only depth resummarize - #4049

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
Mouhand-Kaddo:fix/demons-readonly-resummarize
Oct 12, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
Mouhand-Kaddo:fix/demons-readonly-resummarize

Conversation

@Mouhand-Kaddo

@Mouhand-Kaddo Mouhand-Kaddo commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

What

Demon's Souls PPSA01342 v1.04 issues a pure DB_RENDER_CONTROL.RESUMMARIZE_ENABLE draw with DB_DEPTH_CONTROL=0x007007f3, D32 depth, no stencil plane, zero color writes and no pixel program. After the earlier Windows direct-memory stop is bypassed by #637, main rejects it with:

DB_RENDER_CONTROL depth copy, resummarize or decompress is unsupported (register 0x0 = 0x00000010)

Extend #2178's resident-depth model to this read-only pass. HTILE is not modeled, so recomputing its summary changes no modeled surface state. Accept only pure resummarization with enabled D16/D32 depth that always passes, no depth writes, bounds test or conditional color writes, no stencil plane, zero color writes, and no running pixel stage. Return DrawVerdict::Nothing before shader decoding or pipeline creation. Missing required registers and draws outside these constraints still reject. TechnicalDebt records the boundary.

This is generic register-driven behavior. There is no title check, retry or new environment switch. The PR contains only the resummarize change; #1395's clear/copy recognition and the closed stencil-clear PRs do not implement it.

Tested

Windows 11, i7-13700K, Radeon RX 6900 XT, MinGW-w64, Release, hardware Vulkan, ANYPS5_ENABLE_SPIRV_TOOLS=OFF (default). Based on main 974116d38b1b6ba3ca7e45846c704f2101ec2de3.

  • agc_driver_graphics: the captured register state fails before this change and passes with it. Depth writes, bounds tests, rejecting depth comparisons, a stencil plane, color writes, a running pixel stage, combined maintenance modes, unsupported depth format and missing required registers still reject.
  • agc_driver_readonly_resummarize: submits SET_CONTEXT_REG and DRAW_INDEX_AUTO through the real worker, then waits idle. The unchanged driver throws the exact maintenance rejection above; the changed driver completes. It requires no GPU and exercises the early verdict rather than only the state helper.
  • Full libs build, the two focused tests, and conventions checks pass on the new main. agc_driver passes with Khronos Vulkan validation enabled, without validation errors. Its normal run intermittently exits with Windows heap corruption (0xc0000374). A private baseline probe using the unchanged driver and original submit suite, adding only a zero-count draw (main's existing early no-op), reproduced the same exit on the third run. Thus that failure can occur without this resummarize change; it remains unresolved.
  • Real legal local PPSA01342 game run on the previous main snapshot 989146c3, with fix(libkernel): restore Windows select build for Demons Souls testing #4021 (Windows build guard), fix(shader): keep Demon's Souls loop shader valid after optimization #4018 (loop shader) and fix(libc): track writes to singly mapped direct memory without faults on Windows #637 (direct-memory write tracking), reached the maintenance rejection at about 55–90 seconds without this change. With this change it progressed into further graphics work, then hit an access violation inside amdvlk64.dll (read of 0xffffffffffffffff) near the end of a 300-second observation. No menu or presented frame is claimed. Original game files were preserved.
  • Rebuilt all libraries and relinked the game and its two bundled modules on main 974116d38 with the same test stack. With this change and Khronos validation enabled, the game again advances past resummarization, then exits after 343 seconds with amdvlk64.dll+0x9e251f, read of 0xffffffffffffffff. Validation reports ten forward-compatibility warnings about 3D-image barrier layer counts and no validation errors before the crash. This later driver crash is outside this PR; main-menu boot remains unverified.

Checklist

@btsouth

btsouth commented Oct 12, 2026

Copy link
Copy Markdown

Note

Posted by an AI agent on behalf of Tyler.

Tested on Linux with NVIDIA, Demon's Souls PPSA01342 v1.005 (US). This PR merged locally onto main bab7b32, Release, ANYPS5_ENABLE_SPIRV_TOOLS=ON, APS5_SPIRV_OPT=none. Arch Linux, kernel 7.2.8, GCC 16.2.1, RTX 4070 SUPER on driver 615.78.08.

On plain bab7b32 the title opens its window, presents 2 frames and stops with DB_RENDER_CONTROL depth copy, resummarize or decompress is unsupported (register 0x0 = 0x00000010). With this PR that error is gone. Start-up continues through about 2,450 shader compilations to the save data search, then stops presenting after 2 frames for separate reasons, which I described in #3710.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

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.

Pull request Conflicting files (lines on main) Same exports Same new files
#1368 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp L136

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants