feat(agc): draw radeonsi line and polygon smoothing (SAMPLE_COVERAGE, merged mixed samples) #6530
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6530"
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 milescoviello on 2026-10-15T18:57:09Z.
What
OliSe Player (PPSA01153, catalog 02.001.000) draws through a radeonsi-based GL driver (
ps5-galliumin its log). Its MilkDrop visualizer picks a random preset. With "Rovastar - Dark Ritual (Star Of Destiny Mix)" it smooths lines and polygons the way radeonsi does, andmainstops 20 s in:The draw (from a throwaway print):
PA_SC_AA_CONFIG0x0020c002: 4 samples, 4 exposedVK_FORMAT_R8G8B8A8_UNORM; no depth targetPA_SC_MODE_CNTL_0/_10x23(MSAA_ENABLE) /0x0DB_EQAA0x02130000: OVERRASTERIZATION_AMOUNT 2SPI_PS_INPUT_ENA/ADDR0x4002: PERSP_CENTER, SAMPLE_COVERAGEThis is radeonsi's smoothing setup. With a one-sample framebuffer,
si_emit_msaa_configrasterizesSI_NUM_SMOOTH_AA_SAMPLES= 4 coverage samples and setsOVERRASTERIZATION_AMOUNT(log2 4), so the pixel is written when any of them is covered.si_shader.cenables SAMPLE_COVERAGE_ENA fornir_lower_poly_line_smooth, which scales alpha by the number of covered samples.Two commits:
feat(shader): SAMPLE_COVERAGE.SPI_PS_INPUT_ENA/ADDRbit 14 gives the pixel shader one VGPR after ANCILLARY. The decoder refused it, and the recompiler never loaded that VGPR. It is now loaded fromgl_SampleMaskIn[0](new input kindSampleMask). It shares the variable the partial quad sample mask already declares, since a module may hold only oneSampleMaskinput. On a multisampled draw the hardware word is the whole pixel's coverage, but when the shader runs per samplegl_SampleMaskInholds only that invocation's samples. So per-sample shading is refused, and so are PERSP_SAMPLE, LINEAR_SAMPLE and ANCILLARY beside the coverage input (reading the sample index makes the host shade per sample).feat(agc): merged coverage. A draw with MSAA_ENABLE set, no depth target, no per-sample shading, only one-sample color targets andOVERRASTERIZATION_AMOUNTequal to log2 of the raster samples now decodes withState::mergedCoverage. Before, it threw "a color target's sample count differs from the rasterizer's". Its pipeline keeps the raster sample count, gives the color attachments one sample (VkAttachmentSampleCountInfoNV, or the render pass attachments) and merges coverage (VK_COVERAGE_REDUCTION_MODE_MERGE_NV). A one-sample color pixel is then covered when any raster sample is, andgl_SampleMaskIncarries the four bits. The device enablesVK_NV_framebuffer_mixed_samplesandVK_NV_coverage_reduction_modewhenvkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNVreports merge with one color sample and no depth. On other devices the pipeline throws, so the draw still stops, as it does onmain. Pipeline keys and the draw state comparison include the flag.Tests:
agc_driver_pixel_sample_coverage(new, GPU). A full-target triangle into a one-sample target reads 1 from SAMPLE_COVERAGE alone, after the perspective center pair, and after ANCILLARY. A triangle over half of the target, rasterized with 4 samples into the one-sample target, writes only masks from 1 to 15, at least one 15 and one partial edge mask, and leaves the rest untouched. On a device without merged coverage that part prints a skip line. Onmain's sources the first case fails at once: the first pixel holds (0, 0, 0, 1), as the VGPR is never loaded.agc_driver_graphics.0x4002decodes with the coverage VGPR at 2 and is read fromgl_SampleMaskIn. Beside a partial quad sample mask, the module declares oneSampleMaskinput. On a 2x target, SAMPLE_COVERAGE is refused with PS_ITER_SAMPLE and with an addressed PERSP_SAMPLE, LINEAR_SAMPLE or ANCILLARY. The register set above decodes as merged coverage, and a wrong overrasterization amount, PS_ITER_SAMPLE or MSAA_ENABLE clear are still refused. Onmain'sState.cppthis stops at "a color target's sample count differs from the rasterizer's".Tested
Linux (Ubuntu 24.04, GCC 13.3, Release), RTX 4070 Ti, NVIDIA 595.99:
ctest -R "agc|shader|recompiler|spirv|pixel": 611 of 613.agc_pending_key_storesandagc_driver_store_over_untrackedfail onmainhere too (#6247, #5671).presetsfolder trimmed to that one preset (so the visualizer always picks it), pad input, 120 s:main0029e62f9main03c4cb5e7+ the first commit onlya color target's sample count differs from the rasterizer'smain03c4cb5e7+ both commitsWith the full preset folder (a random preset each run), 2 of 2 180 s runs with both commits reach the limit. PPSA99600, the other app here that uses
ps5-gallium, reaches its 120 s limit onmainand with this PR. The branch is rebased ontomain44df21632, where both test binaries pass 3 of 3.On Windows 11 (RTX 4070, NVIDIA 596.21), @screamm built 087b6337a, ran both test binaries 3 of 3, and confirmed that they fail with this PR's sources reverted. With OliSe,
mainstopped 2 of 2 on the same refusal and this PR reached the 150 s limit 3 of 3. There, though, the visualiser drew black: the menu at half brightness after one Square press, a black window after the second. In my Linux runs the tunnel is visible. Neither setup had a music module playing. screamm then traced the black frame. WithAPS5_NO_RESIDENT_TARGETS=1the three preset targets fill with the tunnel, and the final frame shows it behind the menu. Only the default resident-target path is black, and only there does the log showguest memory changed while GPU results were pending; keeping the CPU's blocks, together with 1,353 storage-image uploads with the reasonuntracked. My Linux runs of this head never log that line (thememory no longer registered; 135 pending ranges droppedline shows up 3 to 4 times on both). So the black frame looks like the Windows host-import comparison discarding the targets' GPU results, not these draws.screamm also caught that this PR's
agc_driver_graphicsfailed when merged with currentmain. #5882 now lets a multisampled scan without MSAA_ENABLE pastDecodeStatewhen there is no depth target, so my last smoothing case is refused at the color sample-count check instead. Rebased ontomain5d9dcc42d(1fd45dc99), with that expectation updated.agc_driver_graphicspasses 3 of 3, and the 469 area tests give 468 passes, the remaining one beingmain'sagc_driver_store_over_untracked(#6385).@johnmaia ran the full suite on AMD (Radeon RX 7600, RADV NAVI33, Mesa 25.2.8, Ubuntu 24.04) with 1fd45dc99 on
main82ddae75b. 1287 of 1288 tests pass, and the one failure ismain'sagc_driver_graphics(#6792).agc_driver_pixel_sample_coveragepasses, and with #6789 merged too,agc_driver_graphicspasses with and without this PR, so the newGraphics.cppcases run there.Rebased onto
main1b1f8483ca(faea7a221), which now has #5907 (simonbronk): multisampled draws into one-sample targets rasterize at sample 0's location, and a sample-coverage input is refused there. The two meet in the color sample-count check. An overrasterized draw (OVERRASTERIZATION_AMOUNTequal to log2 of the raster samples) still decodes as merged coverage, and any other one-sample draw takes #5907's sample-0 path. Two expectations changed with that:agc_driver_graphics,agc_driver_covered_centroid_stateandagc_driver_pixel_sample_coveragepass 3 of 3. Of the 898 area tests (the regex above plus^guest_|libc), all pass exceptmain'sagc_driver_store_over_untracked.6972f7a38c, after @screamm's recheck:
State::mergedCoverageis part of the pipeline store key and is read when the pipeline is created, but the pipeline journal's state codec andCanonicalPipelineStatedropped it. A journalled merged-coverage pipeline therefore replayed as a plain multisampled one, a lost prewarm as screamm noted. The codec and the canonical state now carry it, and the journal format becomes 4. A newagc_pipeline_journalcase round-trips a merged-coverage state and requires the decoded state to key the same pipeline. With the previousPipelineJournal.cppit fails withthe recipe dropped merged coverage; with the change it passes 3 of 3. The AGC area suite (504 tests) passes exceptagc_driver_store_over_untracked, as before. #6639 also moves the format to 4 for its own fields, so whichever of the two merges second will move it to 5.@screamm rechecked 6972f7a38 on Windows (RTX 4070, 596.21). The journal and coverage tests pass 3 of 3. Without the
encodeStateline, or without theCanonicalPipelineStateline, the journal tests fail. #6959 also moves the journal format to 4, like #6639, so whichever of these merges later takes the next number.Not checked in a title on AMD or Intel (where the merged path throws), 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
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T19:31:06Z.
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/Graphics/src/Pipeline.cppL316Some 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.
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/shader/recompiler/Translation/src/InstructionTranslator.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata/StageIO.hppcore/shader/recompiler/Optimization/src/ShaderInfoCollector.cppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppcore/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/shader/recompiler/Translation/src/InstructionTranslator.cppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cppcore/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata/StageIO.hppcore/shader/recompiler/Optimization/src/ShaderInfoCollector.cppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppcore/shader/recompiler/Translation/src/InstructionTranslator.cppcore/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/shader/recompiler/Optimization/src/ShaderInfoCollector.cppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppcore/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderInputState.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppcore/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderInputState.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderInputState.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/shader/recompiler/Translation/src/InstructionTranslator.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/shader/recompiler/Optimization/src/ShaderInfoCollector.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderInputState.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/shader/recompiler/Translation/src/InstructionTranslator.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderInputState.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppImported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-15T21:16:50Z.
Cross-validation on Windows 11 Pro 26220, NVIDIA GeForce RTX 4070 (driver 596.21), WinLibs MinGW-w64 GCC 15.2, PR head
087b6337aon main44df21632(fast-forward, no conflicts):libspass, exceptagc_driver_gpu_indirect_arguments_misaligned_writer_ahead_tests(64 KiB alignment on MinGW), which fails the same way on main (#6452/#6478).agc_driver_graphicsandagc_driver_pixel_sample_coverage,--repeat until-fail:3: 3 of 3 each. The coverage test printed no "merged coverage not tested" line, so the RTX 4070 on Windows takes theVK_NV_framebuffer_mixed_samples+VK_NV_coverage_reduction_modeMERGE path..cppfiles reverted to44df21632(tests and the three headers kept): both tests fail.agc_driver_pixel_sample_coverage:SAMPLE_COVERAGE alone: pixel (0, 0) holds (0.000000, 0.000000, 0.000000, 1.000000);agc_driver_graphics:expected graphics rejection: SAMPLE_COVERAGE in a multisampled pixel shader that runs per sample. Restored and rebuilt: both pass.-j1 --timeout 300 -R '^agc_driver_', minus the unbuildable test): 448 of 452 pass, 2 skipped, 2 fail.agc_driver_preparation_scope_settlefails on main too.agc_driver_sample_mask_drawcrashed once (SegFault) while I ran the non-GPU suite in parallel; it passes 7 of 7 serially on this PR and 7 of 7 on main, so I could not reproduce it.-j8 --timeout 120, loaded host): 814 of 836. Of the 22 failures, 12 are the Python conventions/infra tests timing out (same on main). Of the 10 C++ ones, 9 pass serially;guest_none_relocationstimes out on main too.tools/check_conventions.py --base origin/mainandgit diff --check: pass.OliSe Player PPSA01153 (02.001.000), the same setup as in the description:
presetstrimmed toRovastar - Dark Ritual (Star Of Destiny Mix).milk, Square pressed through scripted pad input once the menu renders, 150 s limit:44df216320xC0000409:terminate called after throwing an instance of 'std::runtime_error'/what(): AGC graphics: unsupported SPI_PS_INPUT_ENA/ADDR bit combination (ena 0x4002 addr 0x4002)The draw no longer stops the title, but the preset is not visible on this machine. After one Square press (the app's help says
VISUALISER: OFF / BEHIND / FULL) the "VISUALISER / TUNNEL" toast appears and the whole frame is the menu at half brightness. 30 frame dumps over about 140 s change only where the menu animates. After a second press ("VISUALISER FULL") the window is completely black apart from the toast (every pixel outside it is 0) for over 60 s. The guest's ownfps:is 0.5 to 1.4 in the visualiser and 28 to 60 in the menu. The host was heavily loaded by parallel builds, so I can't compare the frame rate with your 4 FPS. No module played in my runs: the app's download fails (radio: DOWNLOAD FAILED (-2)) andmusic/is empty. So I can't tell whether the black output is this preset with silent input or a rendering problem. Was a module playing when you took the tunnel screenshots?Cloud Play PPSA99600: main 1 run, this PR 2 runs, all reach 150 s with no stop line (2640; 2270 and 2597 frames). None of the three compiles a
smooth=1shader, so this title does not reach the changed path; it only shows no regression.Not checked: AMD or Intel (where the merged path throws by design), a console, a run with a module playing, the untrimmed preset folder, the frame rate on an idle host, and Linux.
Written with Claude Code assistance (validation by a subagent, reviewed in this session).
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-15T21:18:52Z.
@screamm thanks for the Windows run and the negative control.
No module played in my runs either. My logs show the same lines as yours:
library: /app0/music: 0 module(s)andradio: DOWNLOAD FAILED (-2). So the tunnel in my screenshots came from silent input.On Linux (RTX 4070 Ti, NVIDIA 595.99) the preset was visible a few seconds after the first Square press. After "VISUALISER" the menu sits over the tunnel. After "VISUALISER FULL" the tunnel fills the window, at a guest
fps:of 4.2 to 5.1. So the black visualiser you see doesn't happen here, and I don't know yet why. Youragc_driver_pixel_sample_coveragepass on the MERGE path suggests the smoothed draws work on your driver, but I haven't checked which draw goes black there, so that part is a guess.I'll add your run to the description, including the black output on Windows, so it isn't presented as checked there. If you get to it, a frame dump would show whether the preset's own targets stay black or only the final composite does. No pressure, you've already covered a lot.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-16T07:48:56Z.
Follow-up with the frame dumps, on Windows 11 Pro 26220, NVIDIA GeForce RTX 4070 (596.21), WinLibs MinGW-w64 GCC 15.2: this PR (
087b6337a) merged on main5d9dcc42d(clean). OliSe Player PPSA01153, presets trimmed to the Rovastar preset, Square pressed once after the menu renders, 150 s per run.Short answer: the preset's own targets are not black. When the render targets bypass the resident-image path (
APS5_NO_RESIDENT_TARGETS=1), the three preset targets fill with the tunnel and the final frame shows it behind the menu. On the default path the final frame is black. So the black comes from how the driver keeps resident render targets on this machine, not from the merged-coverage draws.APS5_TRACE_DRAWS=1 APS5_PROFILE_DRAW=1APS5_STORE_AT_FLIP=1APS5_DUMP_STORAGE=22b200000storage_*.rawwas written, so I could not read the resident image itselfAPS5_NO_RESIDENT_TARGETS=1All of these reach the 150 s limit with no stop line (260 to 508 frames, guest
fps:0.3 to 2.0 in the visualiser).Draws after Square (default path, about 140 s): 3145 draws, almost all into three 1920x1080
R8G8B8A8_UNORMtargets (0x228c000001019,0x2296000001008,0x22b200000999 draws). 129 of them also write a linear 1920x1080R16G16_SFLOATtarget (0x22a000000), and 119 go to the two display buffers.Per-draw target dumps (
APS5_DUMP_TARGETS=400, which reads only non-resident targets, so together withAPS5_NO_RESIDENT_TARGETS=1): 241, 213 and 214 dumps of the three preset targets. Only the first one or two of each are all zero. After that they hold the tunnel: values up to 255, the mean of R, G and B reaches 93-98, and 97 % of the pixels are non-zero in the last dumps. Main5d9dcc42dwith the same switches (APS5_DUMP_TARGETS=40) shows the same start in the 24 renders before it stops 5.5 s after Square onAGC graphics: unsupported SPI_PS_INPUT_ENA/ADDR bit combination (ena 0x4002 addr 0x4002).Only on the default path, the log has
[gpu] storage image 0x22b200000: guest memory changed while GPU results were pending; keeping the CPU's blocksand[gpu] storage image 0x22b200000+0x10e0000: memory no longer registered; 135 pending ranges dropped. WithAPS5_PROFILE_DRAW=1, the[storage]lines count 1353 storage-image uploads with the reasonuntracked(22.8 GB) during the run. That looks like the preset images being refilled from guest memory that never received the GPU results, but I have not proven it. Do your Linux logs show these lines?Separate, for the rebase: on current main this PR's
agc_driver_graphicsfails withAGC graphics: unexpected failure: AGC graphics: a color target's sample count differs from the rasterizer's(--covered-centroid-state, i.e.multisampleTests, fails on the merge and passes on main). #5882, merged after44df21632, now accepts a multisampled target without MSAA_ENABLE for filled primitives. Your last smoothing case (smooth.context[0x292] = 2u, expectingmultisampled targets rasterized without MSAA_ENABLE) therefore reaches the colour-target check. The draw is still refused, just with the other message.Not checked: reading the resident images directly on the default path, whether other presets go black on main for the same reason, Square pressed twice (FULL), Linux, AMD or Intel.
Written with Claude Code assistance (validation by a subagent, reviewed in this session).
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-16T07:59:40Z.
Thanks @screamm, both findings were useful.
On your question: my Linux runs of this head (RTX 4070 Ti, Dark Ritual preset, the visualiser showing the tunnel) never log
keeping the CPU's blocks. They do logstorage image 0x22b800000+0x10e0000: memory no longer registered; 135 pending ranges dropped3 to 4 times per run, like yours. Those runs didn't haveAPS5_PROFILE_DRAW, so I have no[storage]upload counts to compare. Together with yourAPS5_NO_RESIDENT_TARGETS=1result, that points at the Windows path where resident targets are compared against guest memory instead of write-tracked, which #6189 also describes. I added this to the description.The rebase: you were right. 1fd45dc99 is on
main5d9dcc42d, and the last smoothing case now expectsa color target's sample count differs from the rasterizer's. The draw is still refused.agc_driver_graphicspasses 3 of 3, and the area tests give 468 of 469, the remaining one beingmain'sagc_driver_store_over_untracked.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by johnmaia on 2026-10-16T13:56:33Z.
AMD run with this head (1fd45dc99) merged onto
main82ddae75b: AMD Radeon RX 7600 (RDNA 3, RADV NAVI33, Mesa 25.2.8), Ubuntu 24.04, GCC 13.3, Release, fullctest -j4.main: 1286 / 1287. With this PR: 1287 / 1288, the same single failure.agc_driver_pixel_sample_coveragepasses.agc_driver_graphics. It fails the same way onmain(#6792, "VOP2 opcode is not implemented") and stops before the cases this PR adds toGraphics.cpp. With #6789 merged as well it passes, with this PR and without, so the new cases run and pass here.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-16T13:59:20Z.
Thanks @johnmaia, the AMD run is very useful, especially confirming that the new
Graphics.cppcases run once #6789 is in. I added it to the description.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-17T10:07:49Z.
Rechecked on head
faea7a221(rebased over #5907), Windows 11 Pro 26220, RTX 4070 (596.21), WinLibs GCC 15.2. Stacked as main5f61879a9+ this PR + #6639 + #6669 (the only conflict is the adjacentRequirelines with #6639 inPipeline.cpp; I kept both). Full build: no failures.agc_driver_graphics,agc_driver_covered_centroid_stateandagc_driver_pixel_sample_coveragepass 3 of 3, with no skip line, so this GPU takes the merged-coverage path. The GPU pass-R '^agc_driver_'passes 484 of 487 with 2 skipped. The one failure,agc_driver_f16_fma_denormal_modes, also fails on plain main here. Non-GPU suite: no real failures.layer, viewport or auxiliary vertex exports is unsupported (register 0x207 = 0x01210000). The stack reaches the limit 2 of 2 with no driver failure. That matches my earlier stacked run.State::mergedCoverageis in the pipeline store key and read by thePipelineconstructor, butPipelineJournal.cppneither encodes it nor keeps it inCanonicalPipelineState. So a journalled merged-coverage pipeline would replay as a non-merged one, and the later draw would miss it and build it again. That is a lost prewarm, not a wrong pipeline. #6639'sea05b7804fixed the same gap for its own fields. I found this by reading the code and did not run a replay.Not checked: the Rovastar preset this time, AMD/Intel, Linux.
Written with Claude Code assistance (validation by a subagent, reviewed in this session).
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-17T10:22:16Z.
Thanks @screamm, good catch on the journal.
PipelineJournal.cppdroppedState::mergedCoveragein both the state codec andCanonicalPipelineState, so a journalled merged-coverage pipeline came back as a plain multisampled one. 6972f7a38c carries it in both, moves the journal format to 4, and adds anagc_pipeline_journalround trip that requires the decoded state to key the same pipeline (it fails with the old codec). Its lines sit beforequadSampleMask, so they don't collide with #6639's. Whichever of the two merges second will bump the format to 5.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-17T11:33:37Z.
Rechecked on head
6972f7a38(scratch-merged onto main673f7406c; this PR merges cleanly alone, #6639 is not needed for the merge). Windows 11 Pro 26220, RTX 4070 (596.21), WinLibs GCC 15.2. Targeted build only (the three AGC driver test targets plus what they link), not a full build. My tree also contained #7035, which touches only libkernel.agc_pipeline_journal,agc_driver_pipeline_journal,agc_driver_graphics,agc_driver_pixel_sample_coverageandagc_driver_covered_centroid_statepass 3 of 3 with ctest--repeat until-fail:3, no skip line.pipelineJournalTests(run byagc_pipeline_journal): encode, decode,mergedCoveragekept, and the store key from the decoded state equals the original and differs from the non-merged one. It covers the recipe codec and the key, not a journal file write and replay of such a pipeline.encodeStateline,agc_pipeline_journalfails (the second run did not load the two recorded pipelines and their three modules) and so doesagc_driver_pipeline_journal(the recipe does not decode). Without the line inCanonicalPipelineState,agc_pipeline_journalfails withthe recipe dropped merged coverage. Restored, all pass.FileFormatgoes 3 to 4 and is used only for the header write and check, so no test pins the number. #6639 (ea05b7804) and #6959 also bump 3 to 4; if their codecs differ, whichever merges later needs the next number, or two codecs share format 4 (a dropped journal tail, not a crash).tools/check_conventions.py --base origin/mainpasses andgit diff --checkis clean.That closes the gap I pointed out.
Not checked: the GPU pass, the non-GPU suite, title runs for this head, AMD/Intel, Linux.
Written with Claude Code assistance (validation by a subagent, reviewed in this session).
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-17T11:43:36Z.
Thanks @screamm for rechecking these on Windows (#6530 journal fix, #7035 timing fix, #6681 relinker side). I added each run to its description, and noted #6959 on #6530.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-17T12:17:06Z.
@milescoviello, about the storage uploads and #6189. I stacked this PR (
6972f7a38) with #6202 (the #6189 fix) on main673f7406c, both clean merges, and compared it with this PR alone. Same OliSe setup as before: Rovastar preset only, Square once, 120 s,APS5_PROFILE_DRAW=1 APS5_PROFILE_GPU=1, Windows 11, RTX 4070 (596.21).untrackeduploads per 10 sBoth runs reach the limit with no stop line, and both log
storage image 0x22b200000+0x10e0000: memory no longer registered; 135 pending ranges droppedfour times.So #6202 removes the refresh write-backs but not the black visualiser and not the
untrackeduploads. Those are still about 23 per present. All of them take the CPU path, at 16.875 MiB each. That is 0x10e0000 bytes, the size of one two-slice 1920x1080 image, so these are uploads of the whole image. The[gputime]storage-uploadclass stays at 0 in both runs, because it times only GPU-direct uploads. Use the[storage]line to count these.The preset targets do have #6189's two-slice array layout, but #6189 doesn't explain the black output.
Written with Claude Code assistance (validation by a subagent, reviewed in this session).
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-17T13:41:06Z.
Thanks @screamm. Here is the same setup on Linux, to compare against your
untrackedcount. Rovastar Dark Ritual preset only, Square once, 120 s,APS5_PROFILE_DRAW=1 APS5_PROFILE_GPU=1. The build ismain40315fcf8cplus this PR (6972f7a38c), on Ubuntu 24.04 with an RTX 4070 Ti (NVIDIA 595.99), 2 runs. The rows are 10 s intervals after the first one:[storage]CPU uploads per 10 sflushed72–74,store57–60,untracked0 (1–2 only in the first 10 s)untrackedmemory no longer registered; 135 pending ranges droppedSo Linux uploads the same whole two-slice 1920x1080 image (0x10e0000 bytes), about 3 times per present. None of those uploads is
untracked: they are flushed CPU writes or stores. Your ~23untrackeduploads per present don't occur here.That supports the earlier reading: on Windows, the resident targets are compared against guest memory rather than write-tracked (#6189's description of that path), and the black frame comes from there. It doesn't come from the merged-coverage draws in this PR. The 2.2 GiB per 10 s of whole-image CPU uploads on Linux is a cost worth looking at too. It's separate from this PR, which doesn't change storage handling.
I didn't dump frames in these runs, so this table has no mean brightness. Earlier Linux runs on this preset showed the tunnel.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-18T19:10:06Z.
Rebased onto
main400baa252b(head d1b6f0871d).State.cpp. The depth check now applies only whenresult.samples > 1. The resolution keeps that condition and this branch'sSAMPLE_COVERAGEcheck before it.tests/Graphics.cppexpects. A one-sample target under a 4x rasterizer with MSAA_ENABLE clear is now drawn as one sample, wheremainused to refuse it. A new commit makes that case expect one-sample rasterization without merged coverage.^agc_driver_graphics$|smooth|coverage|msaa|multisample|sample_maskpass in 2 runs of 2 (RTX 4070 Ti, 595.99.02, Ubuntu 24.04).AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T01:54:33Z.
Rebased onto
main017f2151ca(f0b208a073). Three conflicts:StageIO.hpp:mainadded four barycentric input kinds. This PR'sSampleMasknow comes after them, somain's values don't change.DrawRegisterKey.cpp:mainaddediteratesSamples,positionLocationandsampleLocationsto the pixel key line. This PR'smergedCoveragestays in the sample line.tests/Graphics.cpp:mainnow rasterizesPS_ITER_SAMPLEwith sample-index and position inputs as sample 0 alone instead of refusing it, and that expectation is kept. This PR'sSAMPLE_COVERAGEcase keeps its own refusal.The 596 tests matching
^agc_driver_|^agc_vertex_barrier|recompiler|shader_cache|request_serializer|spirv|^agc_shader|bda|journal|preparedpass, exceptagc_driver_bda_device, which fails onmainhere too (#7571).AI-assisted: yes (Claude Code)