Repository navigation
feat(agc): draw DB stencil copies with a driver pixel program - #16025
1 commit merged into
Conversation
|
Test logs for the description's Tested section, attached below:
Each log's first lines record its tested revision, stencil-copy-build-settings.txt |
|
Windows check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release, with
AI-assisted: yes. |
|
Adding GPU execution coverage on Windows RDNA3: I built PR head
These focused tests do not establish game or console behavior. AI-assisted: yes. |
✅ AMD GPU test: passedPR head
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (6, not counted against this PR)Validation IDs already present on main (4 IDs in 594 tests)Skipped (62)ReproduceAutomated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
✅ NVIDIA GPU test: passedPR head
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Passed on retry (1, failed in the parallel run, passed when re-run with a 360 s timeout; not counted against this PR)Validation IDs already present on main (9 IDs in 594 tests)Skipped (54)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
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.
|
gabichuuuuu
left a comment
There was a problem hiding this comment.
Ran 7b6ac7fb8f merged on main 302864d on Windows 11 x64 (WinLibs GCC 15.2), on an NVIDIA laptop GPU (Turing, driver 621) and an Intel iGPU (driver 101.70xx), with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (Khronos validation layer 1.4.368), ctest -R '^(agc_driver_graphics$|agc_driver_builtin_program_memory|agc_driver_stencil_copy)' -V:
main |
change, 2 runs each | |
|---|---|---|
| NVIDIA | 2/2 | 3/3 twice |
| Intel | 2/2 | 3/3 twice |
- The PR's test changes don't build on
main(DepthCopyPass::stenciland the newDepthCopySourceWordsargument come with this PR), so there's no run of the tests without the change. - The layer was inserted in every test that opens a device (
agc_driver_graphicsopen none). No log haswas not found but was requested by env var VK_INSTANCE_LAYERS, and no log on either side has aVUID-. To be sure validation messages reach these logs, the same layer with best practices on printed 28BestPractices-warnings into anagc_driver_recorderlog on each GPU.
AI-assisted: yes.
|
Test runs for head Linux: Ubuntu 26.04.1, RTX 4070 Ti, NVIDIA 615.71.09, GCC 15.2, Release.
Windows: Windows 11 VM, GeForce GT 1030 (Pascal), NVIDIA 582.78, WinLibs GCC 15.2 UCRT, Release.
Khronos validation layer (added 11-09): Every test I ran passes on this head, apart from any skips listed. AI-assisted: yes (Claude Code) |
|
Ran this PR merged onto
Failures
|
|
A GFX8 data point: AMD Radeon RX 570 (RADV POLARIS10), Mesa 26.2.5, SteamOS 3.8.28 (Arch distrobox), GCC 16.2.1, Release. Head 30 tests, 3 runs each: the stencil and depth copy tests ( The 1,500 AGC, shader, VideoOut and Vulkan tests, this PR on
AI-assisted: yes (Claude Code) |
|
@XatiX I tested this on Divinity: Original Sin 2 - Definitive Edition (PPSA06866) on Windows, and it removes the stop it describes.
That later stop is in the multisample depth code, not in the stencil copy this PR adds. I stacked three open PRs from that area on top of this one. Each still stops on the same message:
Tested on Windows 11, AMD Ryzen 9 7900, RTX 4070 SUPER, WinLibs GCC 15.2.0, Release build. Every run was an unattended launch with no controller input, with the PR's libraries and the libraries that link against them swapped into the converted game. AI-assisted: yes (Claude Code) |
A DB copy with STENCIL_COPY set (DB_RENDER_CONTROL 0x8, alone or with COPY_CENTROID or COPY_SAMPLE) was refused. It now draws the stencil plane into a single-sample R8_UINT color target with a driver pixel program, like the depth copy does for R32 float. The source descriptor reads the stencil plane without HTILE. The program is driver owned, so its code is not captured as guest memory. agc_driver_stencil_copy_draw checks the copied values texel by texel for one- and two-sample planes, including that a sample 1 copy sees a stencil write masked to sample 1 and a sample 0 copy does not, and an alternate-swap target written through green only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp
7b6ac7f to
a7606ec
Compare
4c2ad06
feat(agc): draw DB stencil copies with a driver pixel program
Net of test/dos2-main-04a9eb b411d5f..e3f99a6 over the stencil copy (boykopovar#16025, already in main), without the draw cache and heap-run commits: - falsely flagged pages: NoStoreSinceLastCollect, per-page hashes of what the surface imported, captured or published, capture retries - same-value stores stay visible to publication - publish only the HTILE plane for a read inside it - collect memo in the native depth check, early leave within an epoch - held publication built from a queued fill's pattern, with its test Divinity no longer stops on "native multisample depth publication cannot distinguish..."; it reaches the Campaign menu (direct 130.6 ms, old path 123.1 ms per frame there). agc_driver_native_multisample_depth and agc_driver_stencil_copy_draw pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Divinity is not a test title; upstream reworked this code. DepthSurface.cpp is upstream plus the boykopovar#16025 change. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
What
A DB copy with
STENCIL_COPYset inDB_RENDER_CONTROL(bit 3, alone or withCOPY_CENTROIDorCOPY_SAMPLE) was refused withDB_RENDER_CONTROL depth copy, resummarize or decompress is unsupported. PPSA06866 stops on it on the first loading screen with 0x88, and PPSA05666 sends the same value (#5499, #7649).DecodeDepthCopyPassnow accepts a stencil copy into a single-sampleR8_UINTcolor target and refuses one without a stencil plane, into any other format, or combined with a depth copy. The draw is replaced by a driver pixel program, as the depth copy already is forR32_SFLOAT. It fetches the selected sample of the stencil plane through a descriptor with format 5 and no HTILE, and exports it on the first two channels (SPI_SHADER_COL_FORMAT2, shader mask 3), so a target that swaps or masks to green also gets the value. The two programs (one and two samples) are added toDriverOwnedProgram, so their code is not captured as guest memory.What the console DB writes for a stencil copy is not measured. The export on both channels follows the registers PPSA06866 sets (
CB_COLOR0_INFO0x00050c04,CB_TARGET_MASK0x2,CB_SHADER_MASK0x3).Tests:
agc_driver_stencil_copy_draw. Two stencil draws write 0x25 and then 0x5a over a shifted triangle, the copy runs, and every texel is compared with reference draws of each triangle: the copied value inside the copy's triangle, nothing outside it or in the row padding (theR8_UINTrows are 256 bytes apart). Cases: one sample with 0x88 and 0x08; two samples with 0x88 and 0x108, where the shifted draw is masked to sample 1, so the sample 0 copy must not see it and the sample 1 copy must; and both two-sample cases again into PPSA06866's alternate-swap target written through green.agc_driver_graphics: decode of a stencil copy for one and two samples, its source descriptor, and the three refusals.agc_driver_builtin_program_memory: the stencil copy programs are not captured, as for the depth copy.Tested
ANYPS5_ENABLE_SPIRV_TOOLS=OFF.ctest -V -R "stencil_copy|depth_copy|stencil_known|builtin_program|native_multisample_depth|agc_driver_graphics"withVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_NO_SHADER_CACHE=1andANYPS5_REQUIRE_VULKAN=1. Each log starts with its tested commit and these variables.7b6ac7fb8f, onmain8eca0f607d): 7/7 passed.main8eca0f607d:agc_driver_stencil_copy_drawfails withDB_RENDER_CONTROL depth copy, resummarize or decompress is unsupported (register 0x0 = 0x00000088), the error PPSA06866 stops on. Only that test runs in the control, because the other new checks call functionsmaindoes not have.VUID-line or skips a test. Logs: attached in the first comment.main7ad9749ed0plus only this commit (asddf1290fb7; since then only a test case was added and the branch was rebased): noDB_RENDER_CONTROLrefusal, it reaches the first loading screen and its bar advances (563 presents in the first 10 s), and it stops about 19 s after launch onnative multisample depth publication cannot distinguish an unwritten byte from a same-value guest store. That is the next stop on this title (blocker 4 in Divinity: Original Sin II Definitive Edition (PPSA06866) #13726), not part of this change. The log does not show whether a stencil copy ran before that point: on plainmainblocker 2 came 26 to 35 s in, and the driver logs no stencil copy that succeeds.tools/check_conventions.pypasses. No open PR found for stencil copy.Found while writing the test, not changed here: a guest's stencil bytes are not loaded into a new stencil plane. A stencil EQUAL 0x25 draw over stencil memory filled with 0x25 passed on 0 of 256 texels. The test writes both values with draws, so it does not depend on this.
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