fix(agc): rasterize a single-sample scan into a multisampled depth target at the pixel center #5915

Merged
SandstromPL merged 2 commits from upstream-pr/5915 into main 2026-10-17 10:00:14 +00:00
SandstromPL commented 2026-10-14 15:33:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SandstromPL on 2026-10-14T15:33:27Z.


What

METAL GEAR SOLID: Peace Walker (PPSA18216) stops at its first presentation with:

AGC graphics: the depth target's sample count differs from the rasterizer's

mrfelek reported it on #5268, on main 69e7138ac with #5422 and #5439, and posted the registers of that draw (draw A):

Register Value
PA_SC_AA_CONFIG 0 (one sample)
PA_SC_MODE_CNTL_0 0x2 (MSAA_ENABLE clear)
DB_Z_INFO 0xa290098b (4 samples)
DB_EQAA 0
DB_DEPTH_CONTROL 0x777
color target none

This is the depth version of #4414. #4414 rasterizes a single-sample scan into a multisampled color target with every sample at the pixel center, but it leaves out draws with a depth target. Such a draw now rasterizes the depth target's sample count with every sample at the pixel center, using the custom sample locations from #2169. A 4x color target next to the depth target works the same way.

radeonsi programs this state when GL multisampling is disabled on a multisampled framebuffer:

Two differences from that state:

  • radeonsi's comment lists Z samples as at most the coverage samples (L3439), although it programs 4 Z samples with 1 coverage sample here.
  • radeonsi sets DB_EQAA.MAX_ANCHOR_SAMPLES to the Z sample count, where the game sets DB_EQAA to 0. This change does not depend on MAX_ANCHOR_SAMPLES.

ARB_multisample defines this state: rasterization is single-sample with full coverage, and every sample may take the single-sample depth (L185-L190), with the fragment treated as in multisampling with full coverage (L422-L425). Every sample at the pixel center gives exactly that: each depth and stencil sample is tested and written with the depth at the pixel center. GL also lets an implementation test only a "centermost sample" and set every depth and stencil sample from it (L425-L434), which differs when a pixel's stored samples differ.

Triangles and rectangles are accepted; draw A's depth and stencil fill may well be a rect list. On this path, these throw, most with a new message:

  • points and lines. An aliased line is not a Vulkan multisampled line; #5882 makes the same call.
  • alpha-to-coverage;
  • DB_EQAA Z interpolation or overrasterization (bits 18-19 and 24-27). These could change the per-sample depth;
  • a pixel program reading the sample index (ANCILLARY). Vulkan would run it once per sample, with an index the console does not give. Sample-interpolated inputs are accepted, because the recompiler reads them through barycentrics, which give the center value for every sample here.
  • a sample-mask export;
  • a single-sample color target next to the multisampled depth target. That is mixed samples, which no enabled extension provides. It throws the existing "a color target's sample count differs from the rasterizer's".

#4414's color-only path does not refuse these, and this PR leaves it unchanged. The primitive check moves out of singleSampleMsaaRejection into a helper that both rules use; that rule's behaviour and messages are unchanged.

Not measured on hardware, and recorded in the new debt entry:

  • whether the console tests every sample or only a centermost one, or instead evaluates the depth plane at each sample position (GL allows each);
  • how its occlusion queries count such a draw.

Tested

Ubuntu 24.04, GCC 13.3, Release with BUILD_TESTING=ON, on main 84b01f9cd. Locally, the libusb lines were removed from CMakeLists.txt, because the libusb submodule isn't checked out here.

agc_driver_graphics (tests/Graphics.cpp) gains multisampledDepthTests. Unless stated, each case uses PA_SC_AA_CONFIG 0, MSAA_ENABLE clear and a 4x Z32 depth target.

These now decode, as 4 samples with every location at the pixel center, no sample-location grid and no per-sample shading:

  • draw A's registers (DB_Z_INFO 0xa290098b, DB_DEPTH_CONTROL 0x777, DB_EQAA 0, no color target). The draw precheck accepts it;
  • the same with triangle fans, triangle strips and both rect-list types;
  • a depth clear, which writes with ALWAYS;
  • an ANCILLARY input, when the draw skips its pixel program;
  • a pixel program reading sample-interpolated inputs;
  • a 4x color target next to the depth target, which is kept. PS_ITER_SAMPLE does not turn on sample shading.

These now throw:

  • DB_EQAA Z interpolation;
  • line lists and line strips;
  • alpha-to-coverage;
  • an ANCILLARY input with a pixel program;
  • a sample-mask export;
  • a 1x color target next to the depth target.

Pinned unchanged (these pass on main too):

  • a 4x color target with a 1x depth target;
  • MSAA_ENABLE set, with sample 0 at the center;
  • a 2x rasterizer with the 4x depth target.

On main the test fails at draw A with the message above. With the change it passes, 5 runs out of 5. The existing single-sample MSAA_ENABLE checks still pass, in agc_driver_graphics and agc_driver_msaa_enable_single_sample.

Other checks:

  • Full ctest on the RTX 3050 Ti: 1,159 of 1,161 pass, 12 of them skipping themselves: agc_driver_stencil_ref_export on this GPU, and the VideoOut flip tests, which need a display. The other 2, patched_libraries and guest_usbd, are Not Run because the libusb submodule isn't checked out. All 401 agc_driver tests pass apart from that skip.
  • On the game: with this PR, #5439 and #5882, mrfelek's run gets past draw A on his RTX 3080 Ti. With #6014 and #6196 as well, it gets past draws B and C.
  • What the first presentation hits next:
    1. Draw B: a 4x PA_SC_AA_CONFIG with MSAA_ENABLE clear, over a 4x depth and a 4x color target. #5882 (merged) handles that state without a depth target, and #6014 adds the depth target.
    2. Draw C: a 1x color target under a stale 4x PA_SC_AA_CONFIG, handled by #6196.
    3. A TYPE 14 T# read through a plain 2D access, which needs a hardware-oracle run (#5268).
  • #5882 (merged as 7b20318e8) changed the line next to this change's State.cpp edit.
  • Rebased onto main f474fb776 after #5907 merged. On that head, agc_driver_graphics passes 3 runs out of 3 on the RTX 3050 Ti and on lavapipe. It still fails with main's State.cpp (the depth target's sample count differs from the rasterizer's).
  • #5907 (simonbronk, merged as 24528f4e5) handles the opposite case: a multisampled rasterizer with MSAA_ENABLE set, drawing into one-sample targets. It rewrote the same depth sample-count check, so this PR is rebased onto it: #5907's depthKeepsSampleZero path runs first, then this PR's single-sample-scan path, then one sample-count check that accepts both. The two rules don't overlap: this one needs a single-sample rasterizer with MSAA_ENABLE clear, and #5907 needs a one-sample depth target. The debt file keeps #5907's Custom MSAA sample locations entry, with this PR's entry after it.
  • tools/check_conventions.py from main passes with this title and body.

@mrfelek, thanks for the registers and the runs.

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
  • 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: none
  • Unblocks: PPSA18216 #5268 (draw A of the first presentation; #6014 and #6196 handle draws B and C, see above)
  • GPUs tested: NVIDIA GeForce RTX 3050 Ti Laptop GPU, driver 580.178.04, Ubuntu 24.04 (full ctest; the new checks are host-side decode tests)
  • AI-assisted: yes (Claude Code); I reviewed and tested every line

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4860308499 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5915). Originally posted by [SandstromPL](https://github.com/SandstromPL) on 2026-10-14T15:33:27Z. --- ### What METAL GEAR SOLID: Peace Walker (PPSA18216) stops at its first presentation with: ``` AGC graphics: the depth target's sample count differs from the rasterizer's ``` mrfelek reported it on #5268, on `main` 69e7138ac with #5422 and #5439, and [posted the registers](https://github.com/boykopovar/AnyPS5/discussions/5268#discussioncomment-18926400) of that draw (draw A): | Register | Value | |---|---| | `PA_SC_AA_CONFIG` | 0 (one sample) | | `PA_SC_MODE_CNTL_0` | 0x2 (`MSAA_ENABLE` clear) | | `DB_Z_INFO` | 0xa290098b (4 samples) | | `DB_EQAA` | 0 | | `DB_DEPTH_CONTROL` | 0x777 | | color target | none | This is the depth version of #4414. #4414 rasterizes a single-sample scan into a multisampled color target with every sample at the pixel center, but it leaves out draws with a depth target. Such a draw now rasterizes the depth target's sample count with every sample at the pixel center, using the custom sample locations from #2169. A 4x color target next to the depth target works the same way. **radeonsi** programs this state when GL multisampling is disabled on a multisampled framebuffer: - `MSAA_ENABLE` follows the GL multisample state ([`si_state.c` L1066-L1068](https://github.com/openbsd/xenocara/blob/1b39033df8d928ec247ca64448c4a63c72302db7/lib/mesa/src/gallium/drivers/radeonsi/si_state.c#L1066-L1068)). - `PA_SC_AA_CONFIG` stays 0, and the depth buffer keeps its own sample count ([L3485-L3512](https://github.com/openbsd/xenocara/blob/1b39033df8d928ec247ca64448c4a63c72302db7/lib/mesa/src/gallium/drivers/radeonsi/si_state.c#L3485-L3512)). Two differences from that state: - radeonsi's comment lists Z samples as at most the coverage samples ([L3439](https://github.com/openbsd/xenocara/blob/1b39033df8d928ec247ca64448c4a63c72302db7/lib/mesa/src/gallium/drivers/radeonsi/si_state.c#L3439)), although it programs 4 Z samples with 1 coverage sample here. - radeonsi sets `DB_EQAA.MAX_ANCHOR_SAMPLES` to the Z sample count, where the game sets `DB_EQAA` to 0. This change does not depend on `MAX_ANCHOR_SAMPLES`. **ARB_multisample** defines this state: rasterization is single-sample with full coverage, and every sample may take the single-sample depth ([L185-L190](https://github.com/KhronosGroup/OpenGL-Registry/blob/6af574a14089ccfee87efe230ebcdd8742859813/extensions/ARB/ARB_multisample.txt#L185-L190)), with the fragment treated as in multisampling with full coverage ([L422-L425](https://github.com/KhronosGroup/OpenGL-Registry/blob/6af574a14089ccfee87efe230ebcdd8742859813/extensions/ARB/ARB_multisample.txt#L422-L425)). Every sample at the pixel center gives exactly that: each depth and stencil sample is tested and written with the depth at the pixel center. GL also lets an implementation test only a "centermost sample" and set every depth and stencil sample from it ([L425-L434](https://github.com/KhronosGroup/OpenGL-Registry/blob/6af574a14089ccfee87efe230ebcdd8742859813/extensions/ARB/ARB_multisample.txt#L425-L434)), which differs when a pixel's stored samples differ. Triangles and rectangles are accepted; draw A's depth and stencil fill may well be a rect list. On this path, these throw, most with a new message: - **points and lines.** An aliased line is not a Vulkan multisampled line; #5882 makes the same call. - **alpha-to-coverage**; - **`DB_EQAA` Z interpolation or overrasterization** (bits 18-19 and 24-27). These could change the per-sample depth; - **a pixel program reading the sample index (`ANCILLARY`).** Vulkan would run it once per sample, with an index the console does not give. Sample-interpolated inputs are accepted, because the recompiler reads them through barycentrics, which give the center value for every sample here. - **a sample-mask export**; - **a single-sample color target next to the multisampled depth target.** That is mixed samples, which no enabled extension provides. It throws the existing "a color target's sample count differs from the rasterizer's". #4414's color-only path does not refuse these, and this PR leaves it unchanged. The primitive check moves out of `singleSampleMsaaRejection` into a helper that both rules use; that rule's behaviour and messages are unchanged. Not measured on hardware, and recorded in the new debt entry: - whether the console tests every sample or only a centermost one, or instead evaluates the depth plane at each sample position (GL allows each); - how its occlusion queries count such a draw. ### Tested Ubuntu 24.04, GCC 13.3, Release with `BUILD_TESTING=ON`, on `main` 84b01f9cd. Locally, the libusb lines were removed from `CMakeLists.txt`, because the libusb submodule isn't checked out here. `agc_driver_graphics` (`tests/Graphics.cpp`) gains `multisampledDepthTests`. Unless stated, each case uses `PA_SC_AA_CONFIG` 0, `MSAA_ENABLE` clear and a 4x Z32 depth target. These now decode, as 4 samples with every location at the pixel center, no sample-location grid and no per-sample shading: - draw A's registers (`DB_Z_INFO` 0xa290098b, `DB_DEPTH_CONTROL` 0x777, `DB_EQAA` 0, no color target). The draw precheck accepts it; - the same with triangle fans, triangle strips and both rect-list types; - a depth clear, which writes with ALWAYS; - an `ANCILLARY` input, when the draw skips its pixel program; - a pixel program reading sample-interpolated inputs; - a 4x color target next to the depth target, which is kept. `PS_ITER_SAMPLE` does not turn on sample shading. These now throw: - `DB_EQAA` Z interpolation; - line lists and line strips; - alpha-to-coverage; - an `ANCILLARY` input with a pixel program; - a sample-mask export; - a 1x color target next to the depth target. Pinned unchanged (these pass on `main` too): - a 4x color target with a 1x depth target; - `MSAA_ENABLE` set, with sample 0 at the center; - a 2x rasterizer with the 4x depth target. On `main` the test fails at draw A with the message above. With the change it passes, 5 runs out of 5. The existing single-sample `MSAA_ENABLE` checks still pass, in `agc_driver_graphics` and `agc_driver_msaa_enable_single_sample`. Other checks: - Full `ctest` on the RTX 3050 Ti: 1,159 of 1,161 pass, 12 of them skipping themselves: `agc_driver_stencil_ref_export` on this GPU, and the VideoOut flip tests, which need a display. The other 2, `patched_libraries` and `guest_usbd`, are Not Run because the libusb submodule isn't checked out. All 401 `agc_driver` tests pass apart from that skip. - **On the game:** with this PR, #5439 and #5882, [mrfelek's run](https://github.com/boykopovar/AnyPS5/pull/5915#issuecomment-6172998407) gets past draw A on his RTX 3080 Ti. With #6014 and #6196 as well, [it gets past draws B and C](https://github.com/boykopovar/AnyPS5/pull/6196#issuecomment-6187793360). - **What the first presentation hits next:** 1. Draw B: a 4x `PA_SC_AA_CONFIG` with `MSAA_ENABLE` clear, over a 4x depth and a 4x color target. #5882 (merged) handles that state without a depth target, and #6014 adds the depth target. 2. Draw C: a 1x color target under a stale 4x `PA_SC_AA_CONFIG`, handled by #6196. 3. A TYPE 14 T# read through a plain 2D access, which needs a hardware-oracle run (#5268). - **#5882** (merged as 7b20318e8) changed the line next to this change's `State.cpp` edit. - **Rebased onto `main` f474fb776** after #5907 merged. On that head, `agc_driver_graphics` passes 3 runs out of 3 on the RTX 3050 Ti and on lavapipe. It still fails with `main`'s `State.cpp` (`the depth target's sample count differs from the rasterizer's`). - **#5907** (simonbronk, merged as 24528f4e5) handles the opposite case: a multisampled rasterizer with `MSAA_ENABLE` set, drawing into one-sample targets. It rewrote the same depth sample-count check, so this PR is rebased onto it: #5907's `depthKeepsSampleZero` path runs first, then this PR's single-sample-scan path, then one sample-count check that accepts both. The two rules don't overlap: this one needs a single-sample rasterizer with `MSAA_ENABLE` clear, and #5907 needs a one-sample depth target. The debt file keeps #5907's `Custom MSAA sample locations` entry, with this PR's entry after it. - `tools/check_conventions.py` from `main` passes with this title and body. @mrfelek, thanks for the registers and the runs. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: PPSA18216 #5268 (draw A of the first presentation; #6014 and #6196 handle draws B and C, see above) - [x] GPUs tested: NVIDIA GeForce RTX 3050 Ti Laptop GPU, driver 580.178.04, Ubuntu 24.04 (full `ctest`; the new checks are host-side decode tests) - [x] AI-assisted: yes (Claude Code); I reviewed and tested every line 🤖 Generated with [Claude Code](https://claude.com/claude-code)
mrfelek commented 2026-10-14 16:21:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-14T16:21:17Z.


Real-title check for the Peace Walker case. METAL GEAR SOLID: Peace Walker (PPSA18216), Linux, RTX 3080 Ti (NVIDIA 615.71.09), main e34c47921 plus #5439, this PR and #5882, with the launcher hand-over from boykopovar/AnyPS5#5268. The game loads (345 file opens) and reaches its first presentation. With this PR the original the depth target's sample count differs from the rasterizer's (draw A) no longer throws. The frame then stops at #5882's multisampled targets rasterized without MSAA_ENABLE are unsupported for points, lines, a depth target or alpha-to-coverage (draw B on #5268: PA_SC_AA_CONFIG 0x0020c002, MSAA_ENABLE clear, DB_Z_INFO 0xa290098b, CB_COLOR0_ATTRIB 0x00012000). Draw C was not reached, since B ends the frame first.

AI-assisted; the runs are from my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6172998407 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5915#issuecomment-6172998407). Originally posted by [mrfelek](https://github.com/mrfelek) on 2026-10-14T16:21:17Z. --- Real-title check for the Peace Walker case. METAL GEAR SOLID: Peace Walker (PPSA18216), Linux, RTX 3080 Ti (NVIDIA 615.71.09), `main` e34c47921 plus #5439, this PR and #5882, with the launcher hand-over from boykopovar/AnyPS5#5268. The game loads (345 file opens) and reaches its first presentation. With this PR the original `the depth target's sample count differs from the rasterizer's` (draw A) no longer throws. The frame then stops at #5882's `multisampled targets rasterized without MSAA_ENABLE are unsupported for points, lines, a depth target or alpha-to-coverage` (draw B on #5268: `PA_SC_AA_CONFIG` 0x0020c002, `MSAA_ENABLE` clear, `DB_Z_INFO` 0xa290098b, `CB_COLOR0_ATTRIB` 0x00012000). Draw C was not reached, since B ends the frame first. AI-assisted; the runs are from my machine.
SandstromPL commented 2026-10-14 16:45:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SandstromPL on 2026-10-14T16:45:08Z.


@mrfelek Thanks for the run! That matches the description: draw A gets through, and draw B is next, on #5882's depth-target refusal.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6173463335 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5915#issuecomment-6173463335). Originally posted by [SandstromPL](https://github.com/SandstromPL) on 2026-10-14T16:45:08Z. --- @mrfelek Thanks for the run! That matches the description: draw A gets through, and draw B is next, on #5882's depth-target refusal.
github-actions[bot] commented 2026-10-14 18:20:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T18:20:54Z.


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 6451 docs/dev/debt/libSceAgcDriver.md L124
PR 6470 docs/dev/debt/libSceAgcDriver.md L124
PR 6563 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp L394-400, L411-412
PR 6683 docs/dev/debt/libSceAgcDriver.md L124

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 1191 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 1395 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 2434 docs/dev/debt/libSceAgcDriver.md
PR 4040 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4448 docs/dev/debt/libSceAgcDriver.md
PR 4650 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 5058 docs/dev/debt/libSceAgcDriver.md
PR 5390 docs/dev/debt/libSceAgcDriver.md
PR 5441 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5499 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 5500 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5925 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6188 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6215 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6222 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6235 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6297 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6320 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6412 docs/dev/debt/libSceAgcDriver.md
PR 6529 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6535 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6548 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6647 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6808 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6946 docs/dev/debt/libSceAgcDriver.md
PR 6947 docs/dev/debt/libSceAgcDriver.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6175283704 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5915#issuecomment-6175283704). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-14T18:20:54Z. --- <!-- pr-overlap --> 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 6451](https://www.github.com/boykopovar/AnyPS5/pull/6451) | `docs/dev/debt/libSceAgcDriver.md` [L124](https://github.com/boykopovar/AnyPS5/blob/bf2053816976bb9c821e37df58ef64a7362b81c7/docs/dev/debt/libSceAgcDriver.md#L124) | | | | [PR 6470](https://www.github.com/boykopovar/AnyPS5/pull/6470) | `docs/dev/debt/libSceAgcDriver.md` [L124](https://github.com/boykopovar/AnyPS5/blob/bf2053816976bb9c821e37df58ef64a7362b81c7/docs/dev/debt/libSceAgcDriver.md#L124) | | | | [PR 6563](https://www.github.com/boykopovar/AnyPS5/pull/6563) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp` [L394-400](https://github.com/boykopovar/AnyPS5/blob/bf2053816976bb9c821e37df58ef64a7362b81c7/core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp#L394-L400), [L411-412](https://github.com/boykopovar/AnyPS5/blob/bf2053816976bb9c821e37df58ef64a7362b81c7/core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp#L411-L412) | | | | [PR 6683](https://www.github.com/boykopovar/AnyPS5/pull/6683) | `docs/dev/debt/libSceAgcDriver.md` [L124](https://github.com/boykopovar/AnyPS5/blob/bf2053816976bb9c821e37df58ef64a7362b81c7/docs/dev/debt/libSceAgcDriver.md#L124) | | | 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 1191](https://www.github.com/boykopovar/AnyPS5/pull/1191) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp` | | [PR 1395](https://www.github.com/boykopovar/AnyPS5/pull/1395) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 2434](https://www.github.com/boykopovar/AnyPS5/pull/2434) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 4040](https://www.github.com/boykopovar/AnyPS5/pull/4040) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 4448](https://www.github.com/boykopovar/AnyPS5/pull/4448) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 4650](https://www.github.com/boykopovar/AnyPS5/pull/4650) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 5058](https://www.github.com/boykopovar/AnyPS5/pull/5058) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5390](https://www.github.com/boykopovar/AnyPS5/pull/5390) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5441](https://www.github.com/boykopovar/AnyPS5/pull/5441) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 5499](https://www.github.com/boykopovar/AnyPS5/pull/5499) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 5500](https://www.github.com/boykopovar/AnyPS5/pull/5500) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6215](https://www.github.com/boykopovar/AnyPS5/pull/6215) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6222](https://www.github.com/boykopovar/AnyPS5/pull/6222) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6235](https://www.github.com/boykopovar/AnyPS5/pull/6235) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6297](https://www.github.com/boykopovar/AnyPS5/pull/6297) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6320](https://www.github.com/boykopovar/AnyPS5/pull/6320) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6412](https://www.github.com/boykopovar/AnyPS5/pull/6412) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6529](https://www.github.com/boykopovar/AnyPS5/pull/6529) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6535](https://www.github.com/boykopovar/AnyPS5/pull/6535) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6548](https://www.github.com/boykopovar/AnyPS5/pull/6548) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6647](https://www.github.com/boykopovar/AnyPS5/pull/6647) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6808](https://www.github.com/boykopovar/AnyPS5/pull/6808) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `docs/dev/debt/libSceAgcDriver.md` |
mrfelek commented 2026-10-14 22:04:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-14T22:04:09Z.


Checked, as asked in the description. Peace Walker (PPSA18216), Linux, RTX 3080 Ti (NVIDIA 615.71.09), main b72378b0f plus #5439, this PR (2c8dda1dd), #5882 (e10ec3904) and #6014 (82d90b0ae), with the launcher hand-over from boykopovar/AnyPS5#5268.

  • Draw A gets through with this PR: the depth target's sample count differs from the rasterizer's no longer throws.
  • Draw B gets through with #5882 and #6014 (registers on #6014).
  • The first presentation then stops at draw C: a color target's sample count differs from the rasterizer's (1-sample colour target, no depth, 4-sample PA_SC_AA_CONFIG, MSAA_ENABLE clear).

AI-assisted; the runs are from my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6179490843 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5915#issuecomment-6179490843). Originally posted by [mrfelek](https://github.com/mrfelek) on 2026-10-14T22:04:09Z. --- Checked, as asked in the description. Peace Walker (PPSA18216), Linux, RTX 3080 Ti (NVIDIA 615.71.09), `main` b72378b0f plus #5439, this PR (2c8dda1dd), #5882 (e10ec3904) and #6014 (82d90b0ae), with the launcher hand-over from boykopovar/AnyPS5#5268. - **Draw A gets through** with this PR: `the depth target's sample count differs from the rasterizer's` no longer throws. - **Draw B gets through** with #5882 and #6014 (registers on #6014). - The first presentation then stops at **draw C**: `a color target's sample count differs from the rasterizer's` (1-sample colour target, no depth, 4-sample `PA_SC_AA_CONFIG`, `MSAA_ENABLE` clear). AI-assisted; the runs are from my machine.
SandstromPL commented 2026-10-15 01:58:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SandstromPL on 2026-10-15T01:58:10Z.


@mrfelek Thanks for checking! Draw C is handled in #6196.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6182638960 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5915#issuecomment-6182638960). Originally posted by [SandstromPL](https://github.com/SandstromPL) on 2026-10-15T01:58:10Z. --- @mrfelek Thanks for checking! Draw C is handled in #6196.
simonbronk commented 2026-10-15 10:05:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-15T10:05:41Z.


Overlap note: this PR and #5907 (mine) both edit the depth sample-count check in DecodeState. They conflict when merged together.

They handle opposite cases:

  • This PR: a multisampled depth target under a single-sample scan.
  • #5907: a one-sample depth target under a multisampled rasterizer, keeping sample 0.

They combine without changing either: keep #5907's depthKeepsSampleZero and its sample-zero block. Then put this PR's single-sample-scan block after it, and end with:

Require(!result.depth || depthKeepsSampleZero || result.depth->samples == result.samples, "the depth target's sample count differs from the rasterizer's");

I ran that combination with Onimusha: Way of the Sword (PPSA27836) on main 0afa6a607, Windows, RTX 5070. That title only takes #5907's side (depth 1, raster 2), so this run doesn't exercise this PR's path. Whichever lands second will need this resolution.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6189554761 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5915#issuecomment-6189554761). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-15T10:05:41Z. --- Overlap note: this PR and #5907 (mine) both edit the depth sample-count check in `DecodeState`. They conflict when merged together. They handle opposite cases: - **This PR:** a multisampled depth target under a single-sample scan. - **#5907:** a one-sample depth target under a multisampled rasterizer, keeping sample 0. They combine without changing either: keep #5907's `depthKeepsSampleZero` and its sample-zero block. Then put this PR's single-sample-scan block after it, and end with: ```cpp Require(!result.depth || depthKeepsSampleZero || result.depth->samples == result.samples, "the depth target's sample count differs from the rasterizer's"); ``` I ran that combination with Onimusha: Way of the Sword (PPSA27836) on `main` 0afa6a607, Windows, RTX 5070. That title only takes #5907's side (depth 1, raster 2), so this run doesn't exercise this PR's path. Whichever lands second will need this resolution.
SandstromPL commented 2026-10-15 10:34:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SandstromPL on 2026-10-15T10:34:29Z.


@simonbronk Thanks, agreed! I'd come to the same resolution. I rebuilt it on current main (e49ec591d) with #5907 (2ce4e57a5) and this PR (2c8dda1dd): your depthKeepsSampleZero and sample-zero block, then this PR's single-sample-scan block, then the Require above.

The debt file conflicts too. #5907 rewrites the "Custom MSAA sample locations" entry and this PR adds its entry right after it; keeping both lines resolves it.

With that, agc_driver_graphics passes with both PRs' tests (Linux, RTX 3050 Ti), and ctest -R agc passes 582 of 583. The one failure, agc_pending_key_stores, fails the same way on plain main e49ec591d. If this PR lands second, I'll do the rebase.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6190056981 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5915#issuecomment-6190056981). Originally posted by [SandstromPL](https://github.com/SandstromPL) on 2026-10-15T10:34:29Z. --- @simonbronk Thanks, agreed! I'd come to the same resolution. I rebuilt it on current `main` (e49ec591d) with #5907 (2ce4e57a5) and this PR (2c8dda1dd): your `depthKeepsSampleZero` and sample-zero block, then this PR's single-sample-scan block, then the `Require` above. The debt file conflicts too. #5907 rewrites the "Custom MSAA sample locations" entry and this PR adds its entry right after it; keeping both lines resolves it. With that, `agc_driver_graphics` passes with both PRs' tests (Linux, RTX 3050 Ti), and `ctest -R agc` passes 582 of 583. The one failure, `agc_pending_key_stores`, fails the same way on plain `main` e49ec591d. If this PR lands second, I'll do the rebase.
adriadam10 commented 2026-10-16 11:44:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-16T11:44:35Z.


Re-checked on the PR merged onto current main (65d56a297): agc_driver_graphics passes, and the new multisampledDepthTests fail with main's State.cpp (the original "depth target's sample count differs" message). Rejections, tests and the debt entry match the description; mrfelek's Peace Walker run covers draw A. Merging once main builds again (#6784); #5907 overlaps the same check and will need a small rebase if it lands second.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6214766103 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5915#issuecomment-6214766103). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-16T11:44:35Z. --- Re-checked on the PR merged onto current `main` (65d56a297): `agc_driver_graphics` passes, and the new `multisampledDepthTests` fail with `main`'s `State.cpp` (the original "depth target's sample count differs" message). Rejections, tests and the debt entry match the description; mrfelek's Peace Walker run covers draw A. Merging once `main` builds again (#6784); #5907 overlaps the same check and will need a small rebase if it lands second.
SandstromPL commented 2026-10-16 18:41:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SandstromPL on 2026-10-16T18:41:49Z.


@adriadam10 Thanks for the re-checks! In case it helps break the loop: GitHub shows no merge queue for main and no queue entry for this PR, so nothing will pick it up on its own. Run 38899406464, on the red base eb901bcf4, is still the only full Build on this head (2c8dda1dd). A fresh Build on current main should give it a green report.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6222333967 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5915#issuecomment-6222333967). Originally posted by [SandstromPL](https://github.com/SandstromPL) on 2026-10-16T18:41:49Z. --- @adriadam10 Thanks for the re-checks! In case it helps break the loop: GitHub shows no merge queue for `main` and no queue entry for this PR, so nothing will pick it up on its own. Run 38899406464, on the red base `eb901bcf4`, is still the only full Build on this head (`2c8dda1dd`). A fresh Build on current `main` should give it a green report.
SandstromPL commented 2026-10-16 19:18:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SandstromPL on 2026-10-16T19:18:06Z.


Rebased onto main f474fb776 now that #5907 is in, as agreed with @simonbronk: #5907’s depthKeepsSampleZero path runs first, then this PR’s single-sample-scan path, then one sample-count check that accepts both. agc_driver_graphics passes 3 of 3 on an RTX 3050 Ti and on lavapipe, and the new tests still fail with main’s State.cpp. The debt file keeps both entries.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6222936801 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5915#issuecomment-6222936801). Originally posted by [SandstromPL](https://github.com/SandstromPL) on 2026-10-16T19:18:06Z. --- Rebased onto main f474fb776 now that #5907 is in, as agreed with @simonbronk: #5907’s depthKeepsSampleZero path runs first, then this PR’s single-sample-scan path, then one sample-count check that accepts both. agc_driver_graphics passes 3 of 3 on an RTX 3050 Ti and on lavapipe, and the new tests still fail with main’s State.cpp. The debt file keeps both entries.
adriadam10 commented 2026-10-16 19:47:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-16T19:47:48Z.


Re-checked the rebased head (4355eb4f1) on main: agc_driver_graphics passes and fails without the State.cpp change; #5907's depthKeepsSampleZero path runs first, then the single-sample-scan path, then the single sample-count check. Rejections, tests and the debt entry match the description; mrfelek's Peace Walker run covers draw A. Merging once the full Build on this head is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6223423168 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5915#issuecomment-6223423168). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-16T19:47:48Z. --- Re-checked the rebased head (4355eb4f1) on `main`: `agc_driver_graphics` passes and fails without the `State.cpp` change; #5907's `depthKeepsSampleZero` path runs first, then the single-sample-scan path, then the single sample-count check. Rejections, tests and the debt entry match the description; mrfelek's Peace Walker run covers draw A. Merging once the full Build on this head is green.
adriadam10 commented 2026-10-16 22:51:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-16T22:51:13Z.


Rebased onto current main (57f2a5901): the only conflict was adjacency in tests/Graphics.cpp with the multisampled DCC state test from a0c51d5778; both tests are kept, State.cpp and the debt file merged cleanly. agc_driver_graphics passes on the rebased head and fails without the State.cpp change. Merging once the full Build is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6226174173 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5915#issuecomment-6226174173). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-16T22:51:13Z. --- Rebased onto current `main` (57f2a5901): the only conflict was adjacency in `tests/Graphics.cpp` with the multisampled DCC state test from a0c51d5778; both tests are kept, `State.cpp` and the debt file merged cleanly. `agc_driver_graphics` passes on the rebased head and fails without the `State.cpp` change. Merging once the full Build is green.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!5915
No description provided.