Skip to content

fix(agc): blend RGBA4 targets during PPSA38500 loading on Windows - #28197

Open
lgqdaxia wants to merge 8 commits into
boykopovar:mainfrom
lgqdaxia:codex/ppsa38500-rgba4-blend-loading
Open

lgqdaxia wants to merge 8 commits into
boykopovar:mainfrom
lgqdaxia:codex/ppsa38500-rgba4-blend-loading

Conversation

@lgqdaxia

@lgqdaxia lgqdaxia commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

What

PPSA38500’s first scene on Windows requests blending on a packed RGBA4 target that #27966 can decode but cannot blend. The ordered pixel-interlock path now blends RGB and alpha independently and preserves unwritten channels. For MIN/MAX it multiplies the source and destination by their selected factors before comparing them. AMD PAL · zeezey’s review

This covers single-sample, DCC-disabled targets with BLEND_CLAMP and supported factors. Constant and dual-source factors on written channels are rejected. FP32 packs to nearest even. #23258 handles truncation. Console blend precision is unmeasured.

Tested

On Windows 11 with an RTX 3080 Laptop (621.14), agc_driver_graphics and agc_driver_packed_unorm4444_partial_write failed on cf8530434eaa and passed on 1ad6f125a114. With scaled RGB MAX and alpha MIN, the same starting pixel (0xc369) read back as 0x6fc9 before the fix and the expected 0x2669 after it. Both runs had zero skips, Vulkan validation errors and synchronization errors.

Earlier PPSA38500, NVIDIA and AMD checks

Windows 11, NVIDIA GeForce RTX 3080 Laptop GPU, driver 621.14.

  • The same state-decoder fixture rejects the blend on the fix(agc): support 4_4_4_4 component orders during PPSA38500 loading #27966 production code at e2e97886ee and passes with the follow-up at 4d135930e3.
  • Five Vulkan execution cases passed at 4d135930e3, including pixel readback for a full alternate-order blend and a partial reversed-order blend. No skips or Vulkan validation or synchronization errors.
  • A Windows offline build with the change passed the original rejection and produced outdoor frames in PPSA38500.

At cf8530434eaa, all nine packed-RGBA4 and graphics tests passed on an RX 6650 XT (Arch Linux, RADV Mesa 26.3.1), with zero skips or Vulkan validation errors. On an RX 6700 XT (Windows 11, AMD 32.0.21045.29003), all 62 selected tests passed in each of three runs with zero skips. Linux results · Windows results

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: fix(agc): support 4_4_4_4 component orders during PPSA38500 loading #27966
  • Fixes: none
  • Unblocks: PPSA38500
  • GPUs tested: NVIDIA GeForce RTX 3080 Laptop GPU, NVIDIA 621.14, Windows 11. AMD Radeon RX 6650 XT, RADV Mesa 26.3.1, Arch Linux. AMD Radeon RX 6700 XT, AMD 32.0.21045.29003, Windows 11.
  • AI-assisted: yes

Summary by CodeRabbit

  • New Features
    • Added blending support for single-sample 4:4:4:4 color targets, with separate color and alpha blend operations.
    • Added support for additional component-swapping modes on packed targets. Partial color writes preserve untouched channels.
    • Blending requires clamped output and compatible blend settings. Multisampling, color logic operations, unclamped blending, and certain blend factors remain unsupported.

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: Packed 4:4:4:4 blending

Layer / File(s) Summary
Target mapping and blend-state translation
core/shader/recompiler/Recompiler.hpp, core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp, core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp, core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
The packed blend encoders and UnclampedBlend() helper support blend-state translation. Target decoding accepts component swaps 0–3 for packed 4:4:4:4 UNORM and encodes eligible color and alpha blend equations into merge state.
Packed blend validation and shader merge
core/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cpp, core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cpp, core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp, docs/dev/debt/changes/agc-4444-color-blend.md
Shader input validation accepts packed blend merges with supported formats, mappings, and equations. The SPIR-V emitter blends enabled fields and packs the result before the existing masked merge. The debt note lists documented limitations and unmeasured precision.
Driver and execution coverage
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp, core/libs/prx/libSceAgcDriver/tests/execution/PackedUnorm4444ColorTarget.cpp, core/libs/prx/libSceAgcDriver/tests/execution/PackedUnorm4444PartialWrite.cpp
Tests cover blend acceptance and rejection, full and partial writes, packed export values, and component swaps.

Possibly related PRs

  • boykopovar/AnyPS5#28350: Adds DCC-key encoding to single-sample color-target merge descriptors for DCC-compressed 4:4:4:4 targets, extending the packed target merge path.
  • boykopovar/AnyPS5#28311: Adds rendering support for one-sample, one-mip DCC-compressed 4:4:4:4 UNORM color targets, addressing the same target format.

Suggested reviewers: jab-dev, oneandonlydean

Change: Bug fix

Merge Risk: Minimal · up to cd3c5

This change adds blending for eligible packed 4:4:4:4 targets. Unsupported configurations are still rejected, and the described tests cover the main cases. No merge-blocking risk was found.

Security architecture risk: Minimal · up to cd3c5

The AGC driver enables RGBA4 blending through the existing ordered pixel-merge path. Unsupported configurations still fail before the shader can update the target. The reviewed change did not establish a new security or failure-containment issue.

Security review details

Security Blast Radius

  • inferred — The newly reachable storage-image update is scoped to the draw's selected packed target. The driver derives the descriptor from that target, excludes it from ordinary attachment binding, and rejects competing packed merges in the same draw.

Trust Boundaries and Controls

  • observed — The driver rejects unsupported guest blend modes before creating a merge. The recompiler separately checks packing, sample count, mask width, component mapping, and equation encodings before generating shader code.

Dependencies

  • observed — The newly accepted draws depend on the same host Vulkan pixel-interlock capability as existing packed merges. Where ordered interlock epilogs are unavailable, the existing pipeline selection logic excludes pipeline-library and dynamic color-write-mask paths for interlocked shaders.

Data and control flow

  • observed — Guest color and blend registers become a merge descriptor with a component mapping, separate RGB and alpha equations, and a write mask. The shader reads the destination texel, applies the equations, and preserves the stored bits outside the write mask.

Resilience and Maintainability Implications

  • inferred — Unsupported draw states are rejected before the new merge can write. For accepted draws, the existing ordered interlock covers the destination read and pending-write flush, and the existing early-test checks reject incompatible shader side effects. This is per-pixel ordering, not a promise that an interrupted draw can be rolled back or replayed without blending again.

Rollout and rollback

  • observed — The AGC driver now admits eligible draws that the base rejected, but ShaderRecompiler still stops compilation if the host lacks pixel interlock. The capability decision is automatic; a host without the feature cannot run these draws through this path.
Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 757dac09-d3d7-40df-a67a-b374f912b65c
Commits

Reviewing files that changed from the base of the PR and between 1ad6f12 and cd3c503.

Files selected for processing: 1

  • core/libs/prx/libSceAgcDriver/tests/execution/PackedUnorm4444PartialWrite.cpp

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@JJenkx

JJenkx commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Linux check of the exact head cf8530434eaa. The PR targets a Windows symptom, so this confirms nothing regresses on Linux. Arch Linux 7.3.5 x86-64, GCC 16.2.1, Release, RX 6650 XT / RADV Mesa 26.3.1, Khronos validation layer loaded:

  • ctest -R 'packed_unorm4444|^agc_driver_graphics': 9 pass, 0 skipped. That covers this PR's PackedUnorm4444ColorTarget and PackedUnorm4444PartialWrite tests plus the agc_driver_graphics suite.
  • No VUID- or SYNC- messages.

AI-assisted: yes

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — looks good

Nothing blocks this change; the inspected code implements single-sample RGBA4 blending through the ordered pixel-interlock merge and adds state and execution coverage. The draft covers head cf8530434eaab290f2c1aab93ba640f2ed49f0c3; no checks were run independently, and console blend precision remains unmeasured.

What I ran

Read the prepared description, commits, manifest, diff, and all ten changed files at the pinned head through repo_read.py. The full text of core/libs/prx/libSceAgcDriver/tests/Graphics.cpp was read through the reader because it was too large for the review folder. No build or tests were run independently.

Results

Check Result Note
Changed code review passed Ten changed files read
Build and tests not run Author-reported results only
Console precision not run Unmeasured in the PR description

Findings

Blocking

None.

Non-blocking

None.

Not verified

The PR reports Windows 11 execution on an NVIDIA GeForce RTX 3080 Laptop GPU with driver 621.14, including five Vulkan cases and an offline build. Those results were not independently verified. Console blend precision is unmeasured. No changed files were excluded from review; Graphics.cpp was read through repo_read.py.

To get this to a good state

Nothing is required.

@zeezey

zeezey commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

@lgqdaxia thank you for this, it is the next abort our boots hit (Windows, RTX 4090, PPSA38500).

Two related pieces from our side, in case they're useful here:

  • DCC-compressed 4_4_4_4 targets. With fix(agc): support 4_4_4_4 component orders during PPSA38500 loading #27966 our boots first abort on AGC graphics: DCC-compressed 4_4_4_4 unorm color targets are unsupported, before any blend. We have a fix (fast clears of those targets through R4G4B4A4_UNORM_PACK16, with an execution test under each clear code), and with it the next stop was this PR's blend refusal.
  • Merges into DCC-compressed targets. A 4_4_4_4 target can be both DCC-compressed and blended, so we're adding the key handling for this PR's interlock merge in that case, with tests. It's in progress.

Would you like them on a branch on top of this PR, so you can test them, as we did for #28102? Or would you rather fold them into your PRs, or have them as separate PRs later? Whichever fits your plans.

AI-assisted: yes.

@lgqdaxia

Copy link
Copy Markdown
Contributor Author

Thanks for tracing both stops on the RTX 4090, @zeezey. With DCC enabled, the decoder rejects the RGBA4 target before it reaches the blend code in #28197.

Yes, please put the changes on a branch in your fork based on cf8530434eaa and link it here. We'd be happy to try the fast-clear commit as soon as it's ready, while you're working on the blend. Two commits would let us check the clear by itself, then check that blending over that clear reads the right destination color.

For upstream, I'd keep these as follow-up PRs from your fork. If the clear works on #27966 alone, it can go up first, and the compressed-blend change can follow #28197.

@JJenkx

JJenkx commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Windows/AMD at this head (cf8530434eaa): all 62 tests pass, 3/3 runs, on an RX 6700 XT (AMD 32.0.21045.29003). These are the CTests built from the changed Graphics.cpp, PackedUnorm4444ColorTarget.cpp and PackedUnorm4444PartialWrite.cpp. They include agc_driver_packed_unorm4444_color_target, agc_driver_packed_unorm4444_partial_write and agc_driver_dual_source_blend_state. None were skipped.

This adds the Windows side to the Linux/RADV check above, on an AMD driver as well.

Setup:

  • Windows 11 22621, Ryzen 9 5950X, MinGW-w64 GCC 15.2 UCRT r7, Release.
  • The exact PR head was built (not merged into main).
  • 3 runs through the shared FIFO.

The added test lines have no platform guard.

AI-assisted: yes.

@zeezey

zeezey commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

@lgqdaxia the branch is up: dcc-4444-on-28197, two commits on cf8530434eaa as you suggested:

  1. fix(agc): render DCC-compressed 4_4_4_4 unorm color targets: fast clears of DCC 4_4_4_4 targets through R4G4B4A4_UNORM_PACK16, with agc_driver_packed_unorm4444_dcc_target (+ _no_resident) checking every clear code and swap. It also applies unchanged to fix(agc): support 4_4_4_4 component orders during PPSA38500 loading #27966 alone, and its tests pass there.
  2. fix(agc): keep DCC keys in the merge descriptor of a color target: the merge's T# now carries the DCC keys (key address, ALPHA_IS_ON_MSB, META_PIPE_ALIGNED), so the interlock merge works on a DCC target. The test then draws 24 blends over each clear code and swap and compares them against a 4-bit CPU reference. The title's blended target is DCC-compressed (CB_COLOR_INFO 0x1000884c: SWAP_ALT, BLEND_CLAMP, DCC_ENABLE, 2560x1440, one sample).

Windows / RTX 4090 with the validation layer: the full agc_ suite passes 2314/2341 on the branch against 2312/2339 on this PR's head, with the same single failure on both (agc_driver_linear_target_import_creation), the same skips, and 0 validation errors. On Linux (Ubuntu 24.04, lavapipe) the new tests pass too.

With these, our boots get past both stops (the DCC target, then the blend) and later stop on a different refusal in main (a partial write of a packed target with pixel kill while occlusion queries count samples), which we're working on separately.

AI-assisted: yes.

@lgqdaxia

Copy link
Copy Markdown
Contributor Author

Thanks, @zeezey. We tested the two commits on Windows 11 with an RTX 3080 Laptop (driver 621.14).

  • At c58e1457c183, the fast-clear pixels matched for all four component orders with resident targets enabled and disabled. The patch also applies cleanly to fix(agc): support 4_4_4_4 component orders during PPSA38500 loading #27966 at e2e97886eee1.
  • At 7e46c8259ad3, all 24 blends on the resident target matched the 4-bit reference, across four component orders and six initial states. With resident targets disabled, the clear still passed and the blend was refused as expected.

Both Vulkan tests passed at each commit with zero skips or validation errors. The split makes sense to me. The fast-clear change can follow #27966, and the descriptor change can follow the fast-clear change and #28197.

@zeezey

zeezey commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

@lgqdaxia thanks for testing both on your 3080. Agreed on the order: the fast clear after #27966, then the descriptor change after it and #28197. As a first-time contributor I can only have one pull request open until #28121 is merged, so these follow a short queue; I'll link them here when they're up.

About the next stop I mentioned: it is main's refusal of a partial write or blend into a packed target that merges in the pixel shader, when the shader kills under late tests while occlusion queries count samples. Here it is a MAX blend into the same RGBA4 target, killing pixels, with no depth test. We have a local fix: the merging shader counts the samples that survive its kill, in order with the query segments, so the count stays exact instead of the draw being refused. Its tests pass, and I'm booting the title on it tonight. Since it sits on the same merge path, I can put it on a branch on top of yours too, if you'd like to look at it.

AI-assisted: yes.

@lgqdaxia

Copy link
Copy Markdown
Contributor Author

Yes, @zeezey, please link the branch when it’s ready. A separate commit on 7e46c8259ad3 would let us try the query fix on the same compressed RGBA4 target we just tested. We can work from the branch while #28121 is in the queue.

On that base, CountedKill expects the draw to be refused. If one of your tests reads back the query result, could you share its name and expected count? I’d like to check on the 3080 that the MAX blend counts only the samples that survive the shader discard, and that ordinary draws on either side still contribute exactly once.

@github-actions github-actions Bot added the unblocks title Names a title ID on the Unblocks line label Nov 29, 2026
@zeezey

zeezey commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

@lgqdaxia the occlusion branch is up: query-count-on-28197, one commit on 7e46c8259ad3 as you suggested: fix(agc): count the samples of merging draws that kill under late tests.

The test is CTest agc_driver_packed_unorm4444_partial_write, function CountedKill in PackedUnorm4444PartialWrite.cpp. It reads every interval twice: through the GPU sample dumps (VulkanDevice::DumpSamplesOnGpu, one block per dump at a 256-byte stride; it checks the ready bit 63 and reads the first u64) and through the CPU total (Recorder::CountSamples(), then SamplesTotal()). The count of an interval is the difference between two reads. The scissor is 128×128 (16,384 pixels); the checkerboard kill keeps (x^y)&1 == 0 (8,192) and the stripe kill keeps (x&2) == 0.

# Interval Expected count
1 Full write at z 0.5, checkerboard kill, writes depth 8,192 (queries)
2 X merge at z 0.75: passes depth only where draw 1 killed (8,192), then the stripe kill 4,096 (shader)
3 Killing Y/Z merge at z 0.25, then a non-killing W merge 8,192 (shader) + 16,384 (queries) = 24,576
4 X merge at z 0.75, the depth probe 8,192 (queries)
5 Killing blend of the whole word, no depth test 8,192 (shader)
6 Full write, no kill or depth (16,384, queries); then a MAX blend of the whole word, no depth or stencil test, checkerboard kill (8,192, shader); then a full write at z 0.75 that passes depth where draw 1 killed, stripe kill (4,096, queries) 28,672

Interval 6 is your case: ordinary draws on both sides of a MAX blend (ONE/ONE/MAX on both equations) that kills 8,192 of 16,384, each counted once. Its texels are checked as the per-field maximum (0xa96c from 0xa365 and 0x492c). With precise occlusion queries the counts are compared exactly; without them the test requires the query count to be above the shader part. On this base CountedKill expected the refusal and then a non-killing merge; the commit replaces that with the six intervals.

The counted cases write depth with an always-passing, depth-writing draw at z 1.0 instead of a CPU fill. The driver doesn't read CPU writes into these depth planes, so a CPU fill only looks right because a new surface starts at its clear depth (the existing DepthRejection has the same pattern and fails when run twice in one process). With the draw, three calls on one depth block pass.

Results, RTX 4090 with the validation layer:

  • full agc_ suite: 2314/2341, the same single failure (agc_driver_linear_target_import_creation) and skips as 7e46c8259ad3, 0 VUID-, 0 SYNC-HAZARD;
  • synchronization validation on the 9 sample-dump and interlock tests: all pass on both, 0 hazards;
  • 50 runs in a row of the 4444 test: all pass, the same counts every time;
  • lavapipe (Ubuntu 24.04): 157 focused tests, 0 failures. Lavapipe has pixel interlock, so the 4444 test really runs there, with the same counts as on the 4090.

One thing you may run into: with GPU-assisted validation's shader instrumentation on, every pixel-interlocked merge writes no color, identically on 7e46c8259ad3 and on the branch (also with its descriptor and BDA checks off), so the interlock tests fail under it before any occlusion code runs. With VK_LAYER_GPUAV_SHADER_INSTRUMENTATION=0 all 9 pass.

APS5_TRACE_SHADER_SAMPLES=<n> prints, for each dump, how a count splits between query segments and the shader counter, with program addresses. I'm booting the title on it next to read the real counts at the MAX blend.

AI-assisted: yes.

@lgqdaxia

Copy link
Copy Markdown
Contributor Author

Confirmed on our RTX 3080 Laptop (Windows 11, driver 621.14) at 700c81e8a2e8, @zeezey. CountedKill matched all six expected intervals through both GPU dumps and CPU readback with precise queries. In interval 6, both paths counted 20,480 samples from the two ordinary draws and 8,192 from the MAX blend, for a delta of 28,672.

We also tried the PPSA38500 target settings (CB_COLOR_INFO=0x1000884c, DCC enabled, ALT order) in a test-only variant. A register fast clear was still active when the blend began. All 8,192 surviving pixels read back as 0xca96. Discarded pixels and pixels outside the scissor kept the clear value 0xc492. Both counters again advanced by 28,672. Both tests ran with Vulkan synchronization validation and reported zero validation errors or skips.

The counts and pixels look right for this case on the 3080. This makes sense as a separate follow-up to the two DCC changes.

@github-actions

github-actions Bot commented Nov 29, 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
PR 9748 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp L2210-2213
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp L709-712
core/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cpp L181-182
PR 20010 core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp L712
PR 28945 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp L1133, L1197-1202, L1204, L1217-1218, L2141-2142, L2145, L2168, L2210, L2216-2217
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp L13134, L13470, L13472-13473
core/libs/prx/libSceAgcDriver/tests/execution/PackedUnorm4444PartialWrite.cpp L35, L49, L209, L213, L218-219, L485, L530

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.

Pull request Shared files not compared
PR 1395 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/shader/recompiler/Recompiler.hpp
PR 5925 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
PR 6188 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/shader/recompiler/Recompiler.hpp
PR 6280 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6412 core/shader/recompiler/Recompiler.hpp
PR 6808 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7085 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7275 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
PR 7689 core/shader/recompiler/Recompiler.hpp
PR 8246 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9356 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
PR 9387 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
PR 9508 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
PR 9712 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9852 core/shader/recompiler/Recompiler.hpp
PR 9895 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9897 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
PR 9915 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10193 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
PR 10359 core/shader/recompiler/Recompiler.hpp
PR 10867 core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cpp
PR 11483 core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
PR 11551 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
core/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cpp
PR 11825 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 12828 core/shader/recompiler/Recompiler.hpp
PR 12944 core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
PR 13928 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
PR 13929 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
PR 14032 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
PR 14473 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 14944 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
PR 15343 core/shader/recompiler/Recompiler.hpp
PR 15548 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
PR 15570 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 16391 core/shader/recompiler/Recompiler.hpp
PR 16935 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
PR 17022 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 17056 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/execution/PackedUnorm4444PartialWrite.cpp
core/shader/recompiler/Recompiler.hpp
PR 17611 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
PR 19710 core/shader/recompiler/Recompiler.hpp
PR 20030 core/shader/recompiler/Recompiler.hpp
PR 20111 core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cpp
PR 20153 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cpp
PR 20518 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
core/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cpp
PR 20728 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 22034 core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cpp
PR 22071 core/shader/recompiler/Recompiler.hpp
PR 22251 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cpp
PR 22328 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cpp
PR 22424 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
PR 22439 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
core/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cpp
PR 22446 core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cpp
PR 22514 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 22628 core/shader/recompiler/Recompiler.hpp
PR 22647 core/shader/recompiler/Recompiler.hpp
PR 22697 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 23242 core/shader/recompiler/Recompiler.hpp
PR 23252 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 23258 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/execution/PackedUnorm4444ColorTarget.cpp
core/libs/prx/libSceAgcDriver/tests/execution/PackedUnorm4444PartialWrite.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
core/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cpp
PR 23281 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/execution/PackedUnorm4444ColorTarget.cpp
core/libs/prx/libSceAgcDriver/tests/execution/PackedUnorm4444PartialWrite.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
core/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cpp
PR 23553 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
core/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cpp
PR 23811 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
core/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cpp
PR 24049 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/execution/PackedUnorm4444ColorTarget.cpp
core/libs/prx/libSceAgcDriver/tests/execution/PackedUnorm4444PartialWrite.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
core/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cpp
PR 24083 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 24704 core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
PR 24714 core/shader/recompiler/Recompiler.hpp
PR 24781 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 25010 core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
core/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cpp
PR 25489 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cpp
PR 25684 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 26084 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 26101 core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cpp
PR 26686 core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
PR 28142 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
PR 28176 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
PR 28229 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28250 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28376 core/shader/recompiler/Recompiler.hpp
PR 28387 core/shader/recompiler/Recompiler.hpp
PR 28400 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
core/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cpp
PR 28470 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
PR 28487 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
PR 28488 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
PR 28586 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
core/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cpp
PR 28668 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cpp
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
core/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cpp
PR 28808 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
PR 28964 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp

@github-actions github-actions Bot added the review queue Next in the maintainer review queue: checks pass, no open change request, no conflict label Nov 29, 2026
@ycbuzi

ycbuzi commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Tested cf8530434e merged into main, with the whole ctest suite on each machine below. Nothing fails that does not also fail on main on the same machine.

  • Windows Server 2022 (GitHub-hosted runner), full build, WinLibs GCC 15.2.0: 99% tests passed, 3 tests failed out of 7443; 99% tests passed, 3 tests failed out of 7443. 2 of the failing tests fail on main too. run
  • Windows Server 2025 (GitHub-hosted runner), full build, WinLibs GCC 15.2.0: 100% tests passed, 0 tests failed out of 7443; 100% tests passed, 0 tests failed out of 7443. run

GPU: 16 GPU tests (AGC, shader recompiler) passed twice on a GTX 1650 SUPER (Windows 11, Vulkan required, validation layer on, shader cache off), with this pull request merged into main a0e55122cb. No Vulkan validation message appears that main does not also produce on the same GPU.

AI-assisted: yes (Claude Code); the runs are automated, this summary was written from their reports.

@lgqdaxia

Copy link
Copy Markdown
Contributor Author

Thanks for running this, @ycbuzi. In the Server 2022 artifacts, only the two fullscreen tests failed on both main and the PR. Both reported a missing vulkan-1.dll. The third PR failure was guest_kernel_sys_ksem on the first run and guest_poll on the second. These cover kernel semaphores and file polling, and each passed on the other run. PR results · main results

The blend path has real-GPU results on this head (cf8530434eaa). All nine focused tests passed on the RX 6650 XT under Linux, and all 62 selected tests passed in each of three runs on the RX 6700 XT under Windows. Linux GPU results · Windows GPU results

@klosixgaming-arch

Copy link
Copy Markdown
Contributor

Tested PR #28197 (cf8530434e) on Windows (static checks, all 9 blend / 4_4_4_4 / graphics unit tests, and a 60 s live PPSA38500 soak paired with PR #27590 libs).

Static & Unit Checks (cf8530434e)

  • Static checks: tools/check_conventions.py --base origin/main, tools/debt_fold.py --check, and git diff --check origin/main...HEAD all passed (0).
  • Build (libSceAgcDriver + NID-patched libSceAgcDriver.prx, agc_driver_graphics_tests, all 3 packed_unorm4444 test binaries, and 5 blend test binaries, MinGW GCC/G++ 15.2.0, Ninja Release): Compiles and NID-patches cleanly (0 errors).
  • Windows ctest (9/9 passed in 23.88 s, ANYPS5_GPU=4090, ANYPS5_NO_SHADER_CACHE=1):
    • agc_driver_dual_source_blend -> Passed (1.02 sec)
    • agc_driver_packed_float_blend -> Passed (1.24 sec)
    • agc_driver_packed_unorm4444_color_target -> Passed (1.08 sec)
    • agc_driver_packed_unorm4444_multisample_partial_write -> Passed (1.05 sec)
    • agc_driver_packed_unorm4444_partial_write -> Passed (1.31 sec)
    • agc_driver_reversed_order_blend -> Passed (1.42 sec)
    • agc_driver_swap_alt_blend -> Passed (0.95 sec)
    • agc_driver_unclamped_normalized_blend -> Passed (1.19 sec)
    • agc_driver_graphics -> Passed (13.43 sec)

Live Windows PPSA38500 Verification (Grand Theft Auto VI, v01.002.001)

  • 60 s soak (RTX 4090 + CCD1 non-X3D 0xFFFF0000, 16 threads; paired with PR #27590 libs to bypass the origin/main 0xf000000000 AMM overlap):
    • Rebuilding libSceAgcDriver with recompiler/State changes used a fresh shader disk cache key (e16502258b5bb4b3, format 98), cold-compiling 6,150 misses (6,143 writes, 0 load/write failures) cleanly and reaching 891 presented frames (29.47–29.73 FPS in title bar).
    • PEAK_WS_MIB=3843.5, GPU load 9–30%, ~1.02–1.08 GiB VRAM, zero RGBA4/blend errors; timed out at the 30 s close grace period on teardown.

Tested-on: Windows 11, AMD Ryzen 9 9950X3D (CCD1 non-X3D), NVIDIA GeForce RTX 4090 (driver 617.42)
AI-assisted: yes. Written with AI assistance and reviewed by me.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — looks good

The inspected implementation adds single-sample packed RGBA4 blending with separate color and alpha equations, and I found no concrete defect in the source reviewed.

What I ran

Reviewed head 1ad6f125a114a92c2a85e44317337054a464f34e. No merged-preview check or executable checks were run; the review interface provides repository reads only.

Results

Check Result Note
Source review passed Inspected all changed implementation files and targeted test additions
Executable tests not run No command execution available

Findings

Blocking

None.

Non-blocking

None.

Not verified

Executable tests and runtime behavior were not independently verified. core/libs/prx/libSceAgcDriver/tests/Graphics.cpp was excluded from the prepared bundle because of its size; I read the relevant added section through the pinned reader. All other changed files listed in the manifest were read, including the excluded large file's relevant section. No other files were excluded.

To get this to a good state

Nothing is required.

@JJenkx

JJenkx commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Windows at this head (1ad6f125a114): agc_driver_packed_unorm4444_color_target, agc_driver_packed_unorm4444_partial_write, agc_driver_stencil_ref_export_push_budget, agc_command_batch_fence_failure, agc_graphics_profile_draw, agc_driver_push_constant_assembly, agc_driver_undithered_alpha_to_coverage_state, agc_driver_depth_bounds_state, agc_driver_vertex_control_state, agc_driver_linear_volume_nonresident, agc_driver_msaa_dcc_state, agc_driver_unused_viewport_depth, agc_driver_alpha_to_coverage_state, agc_driver_graphics, agc_sparse_buffer_holes, agc_command_state, agc_copy_input_failure_lifetime, agc_copy_input_kept_bytes, agc_depth_copy_kept_bytes, agc_pipeline_journal, agc_pipeline_journal_size_negative, agc_pipeline_journal_size_overflow, agc_pipeline_journal_long_paths, agc_pipeline_library_clear_waits_for_build, agc_pipeline_library_narrow_keys, agc_pipeline_store_lazy_buffer_pool, agc_pipeline_store_touch, agc_pipeline_deferred_build, agc_pipeline_deferred_build_cache_off, agc_pipeline_store_growth, agc_pipeline_store_fixed_bound, agc_pipeline_store_replay_growth, agc_pipeline_journal_replay_priority, agc_pipeline_journal_extended_paths, agc_heap_mirror_unwatch, agc_heap_mirror_unwatch_no_space_cache, agc_sparse_heap_mirror_unwatch, agc_sparse_heap_mirror_unwatch_no_space_cache, agc_sparse_heap_mirror_budget, agc_heap_mirror_reference_size, agc_heap_mirror_run_unwatch, agc_heap_mirror_run_unwatch_no_space_cache, agc_host_import_validity, agc_address_copy_cap, agc_address_copy_cap_remembered, agc_address_copy_cap_mirror, agc_address_space_unwatched_mirror_import, agc_driver_fault_only_template_records, agc_driver_fault_only_template_records_kept, agc_driver_fault_only_template_records_loop_guard, agc_driver_fault_only_template_records_loop_guard_kept, agc_descriptor_pool_reset_failure, agc_descriptor_cache, agc_driver_address_space_teardown, agc_compute_descriptor_layout_flags, agc_driver_covered_centroid_state, agc_driver_sample_location_grid_fallback, agc_driver_dual_source_blend_state, agc_driver_unobserved_provoking_vertex, agc_driver_sample_order_planning, agc_driver_single_sample_dither_state, agc_driver_recorded_draw_retention pass, 3/3 runs. These are the CTests built from the changed Graphics.cpp, PackedUnorm4444ColorTarget.cpp, PackedUnorm4444PartialWrite.cpp.

Setup:

  • Windows 11 22621, Ryzen 9 5950X, MinGW-w64 GCC 15.2 UCRT r7, Release.
  • The exact PR head was built (not merged into main).
  • 3 runs through the shared FIFO.

The added test lines are not inside a platform guard.

AI-assisted: yes.

@github-actions github-actions Bot removed the review queue Next in the maintainer review queue: checks pass, no open change request, no conflict label Nov 30, 2026
@anova44

anova44 commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

A PPSA38500 (01.002.001) run with and without this, on an RTX 4080: the title asks for this blend in its opening scene, and without the PR that is fatal.

Windows 11 26200, RTX 4080 16 GB, NVIDIA 621.40. Stack as in discussioncomment-20041921 (main 1f27e2abfa + the open PRs listed there, #27966 among them, #20519 lazy with mesh pipelines through the heap) + #27779 + #28311, APS5_OUTPUT_RESOLUTION=1920x1080; the title's own watchdog is lengthened locally.

  • Without: 17 world frames, then at minute 38: what(): AGC graphics: blending into a 4_4_4_4 unorm color target is unsupported.
  • With 1ad6f125a1 merged on top (clean; the two commits beyond fix(agc): support 4_4_4_4 component orders during PPSA38500 loading #27966): one boot so far, 19 world frames in 103 minutes with no such line and no failure, until I stopped it. A second one is running.

One boot each way. I have not compared the picture with and without.

AI-assisted: yes. Claude Code ran the boots and counted the lines.

@JJenkx

JJenkx commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Linux recheck at new head 1ad6f125a114 (Arch Linux, RX 6650 XT, Mesa RADV, Release, Vulkan validation layer inserted and active):

ctest -R 'packed_unorm4444|^agc_driver_graphics': 9/9 passed, 0 skipped, 0 VUID, 0 SYNC-HAZARD.

AI-assisted: yes

@zeezey

zeezey commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@lgqdaxia the third of the follow-ups you asked for is up as #28590 (the occlusion count for merging draws that kill under late tests), stacked on #28350. With #28311 and #28350 that completes the three.

AI-assisted: yes.

@Plyxen Plyxen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read the diff at 1ad6f125a1. Windows 11, GCC 15.2, merged into main at cf556db18c3 together with other open PRs (so not an isolated build), with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 and VK_LAYER_KHRONOS_validation on an RTX 5080 (621.24) and a Radeon iGPU (26.11.2).

  • agc_driver_packed_unorm4444_color_target, agc_driver_packed_unorm4444_partial_write and the 60 tests of agc_driver_graphics_tests: pass on both GPUs. The loader log shows the layer inserted and no "was not found" line, and neither run has a VUID- or SYNC-HAZARD line.
  • Control (same tree and tests, the changed files of those PRs put back to main's): the first two fail on both GPUs: "unsupported color format 19 number type 0 component swap 1".

The tree also had #28311 and #28350, which build on this.

Not checked: PPSA38500 itself.

AI-assisted: yes (Claude Code)

@ligmaSec ligmaSec left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new pixel test assigns the encoded equations directly to color.mergeBlend, and the decoder checks use a separate fixture. Could one pixel case take the decoded PM4 color state through the existing draw path without overriding mergeBlend? The reversed-order partial blend with a separate alpha equation would exercise both register selection and the shader merge in one run.

Source review at 1ad6f125a1. Paired Vulkan execution is pending.

AI-assisted: yes.

@lgqdaxia

lgqdaxia commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

The reversed-order red/alpha case now takes the PM4 target mask and separate blend equations through DecodeState and the existing draw path in cd3c503075d8. The readback checks 0x9686 inside the scissor and 0x963c outside it.

agc_driver_packed_unorm4444_partial_write passed on Windows with an RTX 3080 Laptop GPU. Vulkan validation was active, with zero skips, VUIDs, or synchronization errors. Review

@JJenkx

JJenkx commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Linux recheck at head cd3c503075d8 (the new reversed RGBA4 blend draw test): 9 of 9 pass with none skipped and 0 validation errors.

Setup: Linux 7.3.6, RX 6650 XT (RADV, Mesa 26.3.1), Release build of the PR merged onto current main, Khronos validation layer inserted. ctest filter: packed_unorm4444|^agc_driver_graphics.

AI-assisted: yes

@ligmaSec ligmaSec left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The revised fixture now feeds the reversed RGBA4 PM4 registers through DecodeState and passes the decoded packed blend into the draw. Its readback checks the independently subtracted alpha and the untouched components. That closes my previous coverage request.

Source review at cd3c503075. The revision trial-merges onto 6ef4f2f73b. Paired Linux Vulkan checks are queued.

AI-assisted: yes.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — looks good

The packed RGBA4 blend path and its component mapping handling are consistent with the code inspected; I found no verified blocking defects.

What I ran

Reviewed head cd3c503075d82166ec9e9c202fb1ff1148af8add using repo_read.py and the prepared diff. I did not run tests or builds.

repo_read.py search PackedWriteMask core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp 2080 2205
repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp 2300 2405
repo_read.py cat core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp 625 755
repo_read.py cat core/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cpp 175 205

Results

Check Result Note
Diff and targeted source review passed Reviewed all changed paths in the manifest
Tests at this head not run Author-reported GPU runs used earlier revisions
Build not run No build invoked

Negative control

Not run; no tests were executed.

Findings

Blocking

None.

Non-blocking

None.

Sources

Not verified

No tests or builds were run, and behavior on physical consoles was not confirmed. The prepared diff and targeted source context covered all 11 changed paths listed as reviewed in files.json; that file lists no excluded paths. The large Graphics.cpp source was read at lines 12610–12710 and 12980–13010; its remaining contents were not read. Author-reported GPU results in the description concern earlier revisions and were not independently verified.

To get this to a good state

Nothing is required.

@Plyxen Plyxen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-checked cd3c503, the commit added since my approval at 1ad6f12. It is test-only and draws a decoded reversed RGBA4 blend; it was applied to main 484b036. Windows 11, GCC 15.2, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, VK_LOADER_DEBUG=layer (layer 1.4.363), run once with the RTX 5080 (621.24) and once with the AMD iGPU (26.11.2) loader selected. No VUID- errors in any log, and no was not found but was requested.

  • agc_driver_graphics and agc_driver_packed_unorm4444_{color_target,partial_write,multisample_partial_write}: 4 of 4 pass with each loader.

AI-assisted: yes (Claude Code)

superSniper4576154 pushed a commit to superSniper4576154/AnyPS5 that referenced this pull request Dec 6, 2026
With the 4_4_4_4 blend of boykopovar#28197, a blend into a DCC 4_4_4_4 target
(CB_COLOR_INFO 0x1000884c in PPSA38500: SWAP_ALT, BLEND_CLAMP, DCC_ENABLE,
2560x1440, one sample) threw in ExportTargetMerges: "only single-level
multisampled surfaces and surfaces without metadata have a texture
descriptor encoding". EncodeTextureResource, which builds the T# the
pixel-interlock merge binds as a storage image, refused any surface with
DCC keys.

It now encodes a single-sample surface's DCC keys the way
DecodeTextureResource reads them: META_DATA_ADDRESS in word 6 bits 24-31
and word 7, COMPRESSION_EN (word 6 bit 21), ALPHA_IS_ON_MSB (bit 22) and
META_PIPE_ALIGNED (bit 19). The merge then binds the target's resident
DCC surface, the one the draw refreshes and materializes clear codes in,
with the same keys, so the shader reads the clear values and the keys end
uncompressed. The same holds for an unclamped normalized blend into a
DCC target, which threw the same way. A multisampled surface with DCC
keys still has no encoding, and the message says so. A merge into a 2D
array target with DCC keys now throws in TargetMergeSurface: its merge
surface starts at the array while the keys start at the viewed slice.

The DCC 4_4_4_4 execution test draws 24 blends (SRC_ALPHA /
ONE_MINUS_SRC_ALPHA or ONE / ONE for color, ONE / ONE for alpha, a source
with a clamped 1.25 channel) under each key state (uncompressed, 0000,
0001, 1110, 1111, register clear) and each component swap, and compares
every guest texel with a CPU reference rounded to 4 bits, inside and
outside the scissor, then checks the keys are 0xff. Under
APS5_NO_RESIDENT_TARGETS it checks that the blend is refused ("merged
into its resident image"), as every merge into a non-resident target is;
the debt fragment records that and the other limits. agc_driver_graphics
checks the merge descriptor of a blended DCC 4_4_4_4 target under each
swap and an encode/decode round trip with DCC keys.

Tested with the next commit's tests on boykopovar#28197's head merged with
boykopovar#28311's head, with the Khronos validation layer, on an NVIDIA GeForce
RTX 4090 (Windows 11) and on lavapipe (Linux); the pull request has the
results. Not measured on a console.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NAAUzVZz5igZcosJFfZ3kV
superSniper4576154 pushed a commit to superSniper4576154/AnyPS5 that referenced this pull request Dec 6, 2026
superSniper4576154 pushed a commit to superSniper4576154/AnyPS5 that referenced this pull request Dec 6, 2026

This branch has not been deployed

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

Labels

agc libSceAgc* docs shader core/shader unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants