feat(agc): emulate PA_SC_AA_MASK sample masks #6015
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6015"
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 oneandonlydean on 2026-10-14T19:20:10Z.
What
Emulates
PA_SC_AA_MASK_X0Y0_X1Y0/PA_SC_AA_MASK_X0Y1_X1Y1(one 16-bit sample mask per pixel of the 2x2 quad) instead of refusing the draw withAGC graphics: sample masks are unsupported.pSampleMask.VK_EXT_shader_demote_to_helper_invocation, so derivatives of the covered pixels stay defined); a partial mask is ANDed intogl_SampleMask.OpKillis used only for pixel programs that read no neighbouring lanes; implicit-LOD sampling, LOD queries, whole-quad mode and cross-lane reads (ReadFirstLane,Ballot,PermuteU32) are refused.docs/dev/debt/libSceAgcDriver.md.Carries @MichonGoddijn231849's #448 and @fdfawef324's revision (codex/samplemask-no-demote-review), authorship kept; supersedes #448.
Rebased onto current
main: next tomain's dithered alpha-to-coverage flag (request version 25) andruntimeDescriptorArrayvalidation parameter.Tested
BUILD_TESTING=ON,ANYPS5_ENABLE_SPIRV_TOOLS=ON: allagc_tests (576) and the rest of ctest pass;request_serializerneeded its main-side replays moved to version 29 (last commit). New tests:agc_shader_quad_mask_no_demote,agc_driver_quad_pixel_mask,agc_driver_sample_mask_draw,agc_driver_sample_mask_depth_stencil,agc_driver_sample_mask_multisample.mainStory Mode stops withAGC graphics: sample masks are unsupported. With this PR it gets past that, through the Story Mode loading screen and onto the prologue title card (Ludendorff, North Yankton). The next stop isAGC graphics: CB resolve into a target without a resident image is not implemented, a separate topic.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 github-actions[bot] on 2026-10-14T19:26:10Z.
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.
main)core/libs/prx/libSceAgcDriver/tests/execution/QuadPixelMask.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cppL147core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppL2973, L3088-3089, L3091, L3216-3219, L3221-3222core/shader/recompiler/ControlFlow/src/RequestSerializer.cppL342, L395, L767, L800core/shader/recompiler/Recompiler.hppL156core/shader/recompiler/tests/RequestSerializerTests.cppL205-206, L243-244, L267-268, L390-391, L405core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawDecode.cppL128core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cppL147core/libs/prx/libSceAgcDriver/Graphics/include/State.hppL144core/libs/prx/libSceAgcDriver/Graphics/src/State.cppL1039core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppL2973, L3091, L3216, L3221core/shader/recompiler/ControlFlow/src/RequestSerializer.cppL342, L395, L767, L800core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppL284core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppL2973, L3091, L3216-3217, L3221-3222core/shader/recompiler/ControlFlow/src/RequestSerializer.cppL767, L800core/shader/recompiler/tests/RequestSerializerTests.cppL205-206, L243-244, L267-269, L390-392, L405, L407core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawLookup.cppL75Imported from boykopovar/AnyPS5. Originally posted by fdfawef324 on 2026-10-14T23:23:21Z.
GPUs tested: NVIDIA GeForce RTX 3060 12 GB, driver 591.86, Windows Server 2025 (10.0.26100), Ryzen 9 5900X.
Build: MinGW GCC 15.2, Release -O3,
BUILD_TESTING=ON;libSceAgcDriverplus the test executables below, exit 0, no warnings in files this PR touches.Commits: PR head
9519b53c6, and the same six commits rebased locally onto mainb9d9ec605(clean, no conflicts, not pushed). Each run 3x withctest -j1:request_serializer,agc_shader_memory,agc_shader_quad_mask_no_demote,agc_driver_graphics,agc_driver_quad_pixel_mask,agc_driver_sample_mask_draw,agc_driver_sample_mask_depth_stencil,agc_driver_sample_mask_multisample: 8/8 passed in all 6 runs, none skipped.agc_driver_graphics_tests/agc_shader_memory_testsmodes,agc_driver_image_sample_*,agc_driver_sample_multisample_target,agc_driver_*alpha_to_coverage*,agc_driver_prepared_graphics*,agc_multisample_guest_access: 36/36 passed in all 6 runs.Result lines:
quad pixel mask tests passed (demote to helper invocation),4x sample mask tests passed,quad sample mask depth and stencil tests passed,sample mask draws through the driver passed.Not tested: the kill path without demote on a GPU (this device exposes demote), GTA V, AMD/Intel GPUs, the full ctest suite.
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-15T00:03:16Z.
Rebased onto main (debt entry next to #5631's). A pixel program #5631 skips is replaced by the null pixel program, which applies the quad mask at entry like any other, so the two combine. Thanks @fdfawef324 for the Windows runs.