Repository navigation
feat(agc): merge a draw into more than one unclamped normalized color target - #12916
Merged
oneandonlydean merged 1 commit intoOct 30, 2026
Merged
Conversation
… target A draw that blends into several targets with BLEND_CLAMP clear now carries one merge entry per target. Each entry gets its own storage image and pixel-shader blend, and every pending entry is stored inside the draw's one pixel interlock region. Partial writes of packed targets still merge alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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.
|
12 tasks done
12 tasks done
Contributor
Author
Contributor
✅ 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 (5, not counted against this PR)Validation IDs already present on main (4 IDs in 400 tests)Skipped (40)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. |
12 tasks done
This was referenced Oct 30, 2026
Merged
12 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A draw that blends into more than one color target with BLEND_CLAMP clear stopped with
a draw merges into one color target at most, so blending unclamped normalized color cannot join another merged color target. PPSA26344 (02.002.000) stops on such a draw while it streams its first world cell (#12796). The title's log names MRT1 (CB_COLOR_INFO 0x0000000c,CB_BLEND1_CONTROL 0x40010504). In #675, MRT0 was reported with the same values before #11684. This follows the shape @oneandonlydean suggested on the issue: a list of merge entries, one interlock region, and a two-target case in the unclamped-blend execution test.ShaderPixelStageInfo::targetMergebecomestargetMerges, one entry per merged target.ExportTargetMergesreturns an entry for every target with a partial write mask. The cache key, the draw lookup hash, the draw register key and the recompiler's variant hash cover every entry.FlushColorTargetMergestores each pending entry inside the draw's one pixel interlock region.independentBlend, two merged targets with different blend equations otherwise gave differentpAttachments(VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605).24 files, +371/−212. The tests are +222/−84: the existing tests that read
targetMergemove to the list, and the rest are the new cases below.Tested
CachyOS Linux (kernel 7.3.0-4-cachyos), GCC 16.2.1, Release, NVIDIA GeForce RTX 4070 SUPER (615.78.08).
Head
c037722384onmain1b75a2de11. The tests below ran on the same change onmainb0465557fd(47bdfe07a2). None of the 26 commits between the twomains touch this PR's files.New cases:
agc_driver_graphics:CB_COLOR_INFO 0x0000000candCB_BLEND0_CONTROL/CB_BLEND1_CONTROL 0x40010504at different addresses decode into two merge entries for MRT0 and MRT1. Each has its own descriptor and SRC_ALPHA, ONE_MINUS_SRC_ALPHA, ADD for color and alpha.CB_BLEND1_CONTROLset to ONE, ONE, each entry keeps its own factors.agc_driver_unclamped_normalized_blend: one draw exports MRT0 and MRT1 and blends both, checked per pixel against the CPU reference, on the stored channels:Every draw in the test, including the 20 existing single-target ones, also checks that its pixel shader has one interlock begin and stores every merged target inside it. The test builds the draw state itself, so it reaches the request, the SPIR-V and the pipeline but not register decode; decode is covered by
agc_driver_graphics.agc_shader_memory:Focused run.
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build-tests -V -R '^(request_serializer|agc_shader_memory|agc_driver_graphics|agc_driver_packed_unorm4444_color_target|agc_driver_packed_unorm4444_multisample_partial_write|agc_driver_packed_unorm4444_partial_write|agc_driver_unclamped_normalized_blend)$'mainb0465557fdVUID-lineswas not found but was requested by env var VK_INSTANCE_LAYERSFull suite. 2905 of 2906 pass under the same environment, with no
VUID-line.guest_freebsd_clocksfails because the host zone is not UTC (Tests: guest_freebsd_clocks aborts where the host zone is not UTC #12736) and passes withTZ=UTC.Negative controls. Each control breaks one piece of the change; each is caught:
main's refusal of any second merged targetagc_driver_graphicsfails with the title's messageagc_driver_unclamped_normalized_blendfails: not every merged target is stored inside the interlock regionagc_driver_unclamped_normalized_blendfails on MRT1's pixelsagc_driver_unclamped_normalized_blendpasses, but the validation layer reportsVUID-…-00605twiceagc_shader_memoryfailsPPSA26344 (02.002.000). One run each from launch, same files and settings, with
anyps5-entitlements.inilisting the add-on label the title needs:main5454cd2e455454cd2e45(3cbd74244b)c037722384These runs show the draw no longer stops the title. They don't show that the merged targets look right, since
mainnever got past this point to compare against; the execution test checks that.python3 tools/check_conventions.py --base origin/mainandgit diff --checkpass.Not checked:
DrawDecode,DrawLookup,DrawRegisterKey), other than in the PPSA26344 run.A merged target beside a target that blends normally still gives that target's attachment state next to an empty one. Without
independentBlendthis is the samepAttachmentsdifference as onmainbefore this change; the focused and full runs report noVUID-line for it.Overlap.
tools/pr_overlap.py(main609422fefe) reports no overlap for the pull requests it could compare. For the 77 it could not, I merged each with this branch and withmainand compared the conflicts in shared files:TargetMerge. This branch adds conflicts inCacheKey.hpp,DrawLookup.cpp,Recompiler.cpp,ShaderStageInputInfo.hppandShaderInputInfoBuilder.cpp, and its lines fall inside their existing conflicts inRequestSerializer.cpp,SpirvModuleEmitter.cpp,State.cppandShaderMemory.cpp.State.cppand the multisampled 4_4_4_4 tests.DrawRegisterKey.cppandShaderInfoCollector.cpp.State.cpp,CacheKey.hpp,Recompiler.hppandSpirvModuleEmitter.cpp.main(7): fix(agc): grow the storage cache budget while it evicts under pressure #6194, perf(agc): reuse image-table elements whose descriptors repeat #6223 and fix(agc): take a host-coherent memory type for a host import (#6512) #6548 (libSceAgcDriver.md); perf(shader): let spanned waves run at any host subgroup size where it can be narrower than 32 #8004, feat(agc): run mesh-path draws through a compute pass on devices without mesh shaders #9356 and feat(agc): emulate mesh-fallback barycentrics through tessellation #9387 (RequestSerializerTests.cpp); feat(agc): apply a T#'s MIN_LOD clamp in the shader without VK_EXT_image_view_min_lod #12662 (ShaderMemory.cpp).main.All 13 are older, so this lands after them, recorded in Depends on. I'll rebase onto whichever merges first.
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