fix(agc): store only the bytes a synchronous draw changed in a linear color target #9202

Merged
thuanquang merged 2 commits from upstream-pr/9202 into main 2026-10-27 01:57:47 +00:00
thuanquang commented 2026-10-21 15:11:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-21T15:11:07Z.


What

A draw into a color target without a resident image is synchronous. It works in five steps:

  1. The driver reads the target from guest memory.
  2. It uploads the target to a per-draw image.
  3. It draws.
  4. It reads the image back.
  5. It stores the result in guest memory.

For a linear target it read and stored the whole target, even when the draw's scissor covered a small part of it. The store also rewrote every byte with what was read before the draw, so a guest CPU store made to the target while the draw ran was lost.

The draw cannot write outside State::scissor, the intersection of the screen, window, generic and viewport scissors, which lies inside every bound target. So, for a linear target without DCC whose scissor is smaller than the target, the synchronous draw now:

  • reads only the guest bytes from the scissor's first pixel to its last, which are its rows at the target's pitch;
  • uploads and reads back only the scissor rectangle, with bufferRowLength set to the pitch;
  • stores those rows with GuestMemory::WriteChanged against the bytes it read, as the GPU-tiled path already does, so only the bytes the draw changed are written.

A scissor that covers the whole target, other tile modes and DCC targets take the old path.

Why

PPSA14363 (METAL GEAR SOLID Master Collection Vol. 1) draws its PS1 games into three linear 3072x2048 R8G8B8A8 color targets of 24 MiB each. They have no host import, so every draw into them is synchronous. In the PS1 intro there are up to about 80 such draws per frame. A local trace of their scissors found almost all at (0,0) 320x224: each draw moved 24 MiB in and 24 MiB out for an area of 280 KiB.

On main every draw into these targets is synchronous. #9879 creates their host import; in our runs with its branch (2026-10-23) the PS1 part made no synchronous draws on the RX 6700 XT, so once #9879 is merged this change no longer speeds up PPSA14363 there. It still applies to every target #9879 keeps synchronous, and the lost-store fix does not depend on any title. The two PRs merge cleanly in either order.

Tested

Rechecked merged onto main 14c99b52ac (2026-10-26, AMD Windows driver 32.0.21045.16010): head a39a7d1f43 sets APS5_NO_RESIDENT_LINEAR=1 in the test before its first draw, so its targets stay on the synchronous path this PR changes, also once #9879 gives linear color targets a host import.

  • With main's Draw.cpp the new test fails in 3 of 3 rounds with the message below; with this change it passes 3 of 3.
  • 16 tests pass 3 of 3: the 12 listed below, agc_buffer_pool, and three more tests that make synchronous draws with a partial scissor: agc_driver_cmask_fast_clear (a linear target with a padded pitch), agc_driver_srgb8_color_target and agc_driver_packed_unorm4444_color_target.
  • Under the validation layer (inserted in all 15 GPU test processes, no "was not found" line), the only VUID- errors are 3 of VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 in agc_driver_srgb8_color_target. Plain main 14c99b52ac reports the same 3 there (#6782 enables independentBlend). The other 14 GPU tests have none, and with main's Draw.cpp the new test has none either.

New test: agc_driver_linear_target_scissor_rows, on linear R32G32B32A32 targets with no host import, so their draws are synchronous. Four cases:

  1. A whole-target scissor, 64x64.
  2. A scissor of full rows, 64x64.
  3. A partial scissor (8,16) 32x16, 64x64. While its write-back runs, the test stores two texels as a guest CPU would: one in a row outside the scissor, and one in a scissor row outside its columns. It does this through SetFlushHook, at the Store read site.
  4. A partial scissor (8,0) 32x1 on a one-row 64x1 target, with one such store outside the scissor.

In every case, pixels inside the scissor must hold their position, pixels outside keep their bytes, and both CPU stores survive.

  • main cecb540a63 with only the test fails:
    AGC graphics: partial scissor: pixel (2, 2) outside the scissor holds byte 255 at 0, expected 17 (the CPU stored it while the draw ran)
    
  • With this change it passes 3 of 3.
  • Rebased onto main 4777caca34 (head c01f5cb9c8), after 930b9640d7 split Graphics::Draw into a prepare and a record step. The band fields moved into the file-scope TargetBinding; nothing else changed. On that head, with AMD driver 32.0.21045.16010, the 12 tests below pass 3 of 3, and with main's Draw.cpp the new test fails with the message above.

RX 6700 XT (gfx1031), AMD Windows driver 32.0.21045.5002, Windows 11 26200, MinGW GCC 15.2 Release:

  • 12 tests, 3 rounds, all pass: the new test, 10 tests that draw through non-resident color targets and agc_driver_linear_target_resident, whose target is imported and resident:
    • agc_driver_uint8x4_color_target_no_resident
    • agc_driver_color1555_target, agc_driver_color565_target
    • agc_driver_packed_float_color_target, agc_driver_packed_unorm_color_target, agc_driver_packed_mip_tail_target
    • agc_driver_pixel32_ar_export, agc_driver_pixel_uint16_export
    • agc_driver_pixel_ancillary_word, agc_driver_pixel_fixed_point_position
    • agc_driver_linear_target_resident

Khronos validation layer A/B (VK_LOADER_DEBUG=layer shows the layer inserted in all 12 test processes on both sides, with no "was not found" line), same 12 tests:

  • main with only the new test: 11 of 12 pass (the new test fails as above), 0 VUID- lines.
  • This PR: 12 of 12 pass, 0 VUID- lines.

PPSA14363 (own dump), RX 6700 XT:

  • Runs. One run each, 150 s, APS5_PROFILE_DRAW=1, warm shader cache, the same scripted input into the PS1 section.
  • Local change on both sides: stop 1, sceNpTrophy2GetTrophyInfo: trophy 19 is not in .../trophy00.ucp, was bypassed locally; #9115 fixes it.
  • Results. Per synchronous draw, from the [draws] lines of the 10 s windows with at least 50 of them:
per synchronous draw main cecb540a63 this PR
average 16.3 to 32.4 ms 5.2 to 8.3 ms
readTarget (read of the target) 1.4 to 2.5 ms 0.67 to 2.2 ms
sync (upload, draw, read back, wait) 4.5 to 7.8 ms 0.44 to 1.4 ms
writeBack (store to guest memory) 6.6 to 11.5 ms 0.26 to 1.0 ms
prepare (per-draw image, see #9188) 3.6 to 7.2 ms 3.4 to 4.4 ms

The 3300th guest flip (the flip counts of the [packets] lines) came after 84.4 s on main and 70.8 s with this change. Assuming the title advances one frame per flip, both had reached the same content by then.

This change is independent of #9188, which removes most of the remaining prepare time. With both changes merged locally onto main d34da5d694, one run of main and two of the change, same setup:

main both, run 1 both, run 2
average synchronous draw 18.4 to 22.3 ms 2.9 to 9.7 ms 1.4 to 3.5 ms
flips/s, flips 3000 to 3300 15.4 46.1 58.1
flips/s, flips 3300 to 3600 18.5 39.8 46.5
flips/s, flips 3600 to 3900 8.6 19.6 35.3

Run 1's sync phase was 1.6 to 3.1 ms per draw, against 0.35 to 1.1 ms in run 2, with the same build. Another lane on this PC may have been building during run 1.

Gameplay, 2026-10-22: main 6ef5a1c4c9 + #9115 + #9373 on both sides. libSceAgcDriver.prx was built with and without #9188 and #9202; nothing else differs. Two 600 s runs per side, alternating, with the same scripted input and APS5_PROFILE_DRAW=1:

without #9188 and #9202 with both
MGS1 opening and codec, presents per 10 s 38 to 74 168 to 190
average synchronous draw 17.7 to 27.1 ms (one window 76 ms) 4.6 to 7.4 ms in the opening and codec, 1.3 to 2.1 ms at the Dock
codec line "The Codec's receiver directly stimulates the small bones of your ear." at 440 s and 538 s at 183 s and 204 s
Dock gameplay, radar on screen not reached in 600 s (both runs) at 237 s and 268 s

No run stopped. The second run with both changes was slower at the Dock (107 to 147 presents per 10 s, against 124 to 196 in the first). These runs held only this PC's GPU lock, so other work on the PC may have slowed it. The title's progress is tracked in its bring-up discussion, #9615.

Other GPUs, from reviewers: @simnJS, GeForce RTX 4080 SUPER, driver 616.92, Windows 11 Pro 26200, on the earlier head 40e6e9247 (before the one-row case):

  • agc_driver_linear_target_scissor_rows passes 3 of 3.
  • With main's Draw.cpp it fails 3 of 3 with the same partial-scissor message.
  • The other 11 tests pass 3 of 3 on both.

@jotitadev, Ubuntu 26.04, NVIDIA GeForce RTX 3070 (driver 595.99.02) and lavapipe (Mesa 26.0.3), on the earlier head eab9f18d2 on main 0c6a5bd59 (the rebase to c01f5cb9c8 only moved the band fields into TargetBinding):

  • agc_driver_linear_target_scissor_rows passes 3 of 3 on both.
  • With main's Draw.cpp and only this PR's test it fails on both with the same partial-scissor message.

Not tested: AMD GPUs other than the RX 6700 XT, AMD on Linux.

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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: AMD Radeon RX 6700 XT (gfx1031), AMD Windows drivers 32.0.21045.5002 and 32.0.21045.16010, Windows 11 26200; NVIDIA GeForce RTX 4080 SUPER, driver 616.92, Windows 11 (simnJS, earlier head); NVIDIA GeForce RTX 3070, driver 595.99.02, and lavapipe (Mesa 26.0.3), Ubuntu 26.04 (jotitadev, earlier head)
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4953847116 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9202). Originally posted by [thuanquang](https://github.com/thuanquang) on 2026-10-21T15:11:07Z. --- ### What A draw into a color target without a resident image is synchronous. It works in five steps: 1. The driver reads the target from guest memory. 2. It uploads the target to a per-draw image. 3. It draws. 4. It reads the image back. 5. It stores the result in guest memory. For a linear target it read and stored the whole target, even when the draw's scissor covered a small part of it. The store also rewrote every byte with what was read before the draw, so a guest CPU store made to the target while the draw ran was lost. The draw cannot write outside `State::scissor`, the intersection of the screen, window, generic and viewport scissors, which lies inside every bound target. So, for a linear target without DCC whose scissor is smaller than the target, the synchronous draw now: - reads only the guest bytes from the scissor's first pixel to its last, which are its rows at the target's pitch; - uploads and reads back only the scissor rectangle, with `bufferRowLength` set to the pitch; - stores those rows with `GuestMemory::WriteChanged` against the bytes it read, as the GPU-tiled path already does, so only the bytes the draw changed are written. A scissor that covers the whole target, other tile modes and DCC targets take the old path. ### Why PPSA14363 (METAL GEAR SOLID Master Collection Vol. 1) draws its PS1 games into three linear 3072x2048 R8G8B8A8 color targets of 24 MiB each. They have no host import, so every draw into them is synchronous. In the PS1 intro there are up to about 80 such draws per frame. A local trace of their scissors found almost all at (0,0) 320x224: each draw moved 24 MiB in and 24 MiB out for an area of 280 KiB. On `main` every draw into these targets is synchronous. #9879 creates their host import; in our runs with its branch (2026-10-23) the PS1 part made no synchronous draws on the RX 6700 XT, so once #9879 is merged this change no longer speeds up PPSA14363 there. It still applies to every target #9879 keeps synchronous, and the lost-store fix does not depend on any title. The two PRs merge cleanly in either order. ### Tested **Rechecked merged onto `main` `14c99b52ac`** (2026-10-26, AMD Windows driver 32.0.21045.16010): head `a39a7d1f43` sets `APS5_NO_RESIDENT_LINEAR=1` in the test before its first draw, so its targets stay on the synchronous path this PR changes, also once #9879 gives linear color targets a host import. - With `main`'s `Draw.cpp` the new test fails in 3 of 3 rounds with the message below; with this change it passes 3 of 3. - 16 tests pass 3 of 3: the 12 listed below, `agc_buffer_pool`, and three more tests that make synchronous draws with a partial scissor: `agc_driver_cmask_fast_clear` (a linear target with a padded pitch), `agc_driver_srgb8_color_target` and `agc_driver_packed_unorm4444_color_target`. - Under the validation layer (inserted in all 15 GPU test processes, no "was not found" line), the only `VUID-` errors are 3 of `VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605` in `agc_driver_srgb8_color_target`. Plain `main` `14c99b52ac` reports the same 3 there (#6782 enables `independentBlend`). The other 14 GPU tests have none, and with `main`'s `Draw.cpp` the new test has none either. **New test:** `agc_driver_linear_target_scissor_rows`, on linear R32G32B32A32 targets with no host import, so their draws are synchronous. Four cases: 1. A whole-target scissor, 64x64. 2. A scissor of full rows, 64x64. 3. A partial scissor (8,16) 32x16, 64x64. While its write-back runs, the test stores two texels as a guest CPU would: one in a row outside the scissor, and one in a scissor row outside its columns. It does this through `SetFlushHook`, at the `Store` read site. 4. A partial scissor (8,0) 32x1 on a one-row 64x1 target, with one such store outside the scissor. In every case, pixels inside the scissor must hold their position, pixels outside keep their bytes, and both CPU stores survive. - `main` `cecb540a63` with only the test fails: ``` AGC graphics: partial scissor: pixel (2, 2) outside the scissor holds byte 255 at 0, expected 17 (the CPU stored it while the draw ran) ``` - With this change it passes 3 of 3. - Rebased onto `main` `4777caca34` (head `c01f5cb9c8`), after 930b9640d7 split `Graphics::Draw` into a prepare and a record step. The band fields moved into the file-scope `TargetBinding`; nothing else changed. On that head, with AMD driver 32.0.21045.16010, the 12 tests below pass 3 of 3, and with `main`'s `Draw.cpp` the new test fails with the message above. **RX 6700 XT** (gfx1031), AMD Windows driver 32.0.21045.5002, Windows 11 26200, MinGW GCC 15.2 Release: - 12 tests, 3 rounds, all pass: the new test, 10 tests that draw through non-resident color targets and `agc_driver_linear_target_resident`, whose target is imported and resident: - `agc_driver_uint8x4_color_target_no_resident` - `agc_driver_color1555_target`, `agc_driver_color565_target` - `agc_driver_packed_float_color_target`, `agc_driver_packed_unorm_color_target`, `agc_driver_packed_mip_tail_target` - `agc_driver_pixel32_ar_export`, `agc_driver_pixel_uint16_export` - `agc_driver_pixel_ancillary_word`, `agc_driver_pixel_fixed_point_position` - `agc_driver_linear_target_resident` **Khronos validation layer A/B** (`VK_LOADER_DEBUG=layer` shows the layer inserted in all 12 test processes on both sides, with no "was not found" line), same 12 tests: - `main` with only the new test: 11 of 12 pass (the new test fails as above), 0 `VUID-` lines. - This PR: 12 of 12 pass, 0 `VUID-` lines. **PPSA14363** (own dump), RX 6700 XT: - **Runs.** One run each, 150 s, `APS5_PROFILE_DRAW=1`, warm shader cache, the same scripted input into the PS1 section. - **Local change on both sides:** stop 1, `sceNpTrophy2GetTrophyInfo: trophy 19 is not in .../trophy00.ucp`, was bypassed locally; #9115 fixes it. - **Results.** Per synchronous draw, from the `[draws]` lines of the 10 s windows with at least 50 of them: | per synchronous draw | `main` `cecb540a63` | this PR | |---|---|---| | average | 16.3 to 32.4 ms | 5.2 to 8.3 ms | | `readTarget` (read of the target) | 1.4 to 2.5 ms | 0.67 to 2.2 ms | | `sync` (upload, draw, read back, wait) | 4.5 to 7.8 ms | 0.44 to 1.4 ms | | `writeBack` (store to guest memory) | 6.6 to 11.5 ms | 0.26 to 1.0 ms | | `prepare` (per-draw image, see #9188) | 3.6 to 7.2 ms | 3.4 to 4.4 ms | The 3300th guest flip (the `flip` counts of the `[packets]` lines) came after 84.4 s on `main` and 70.8 s with this change. Assuming the title advances one frame per flip, both had reached the same content by then. This change is independent of #9188, which removes most of the remaining `prepare` time. With both changes merged locally onto `main` `d34da5d694`, one run of `main` and two of the change, same setup: | | `main` | both, run 1 | both, run 2 | |---|---|---|---| | average synchronous draw | 18.4 to 22.3 ms | 2.9 to 9.7 ms | 1.4 to 3.5 ms | | flips/s, flips 3000 to 3300 | 15.4 | 46.1 | 58.1 | | flips/s, flips 3300 to 3600 | 18.5 | 39.8 | 46.5 | | flips/s, flips 3600 to 3900 | 8.6 | 19.6 | 35.3 | Run 1's `sync` phase was 1.6 to 3.1 ms per draw, against 0.35 to 1.1 ms in run 2, with the same build. Another lane on this PC may have been building during run 1. **Gameplay, 2026-10-22:** `main` `6ef5a1c4c9` + #9115 + #9373 on both sides. `libSceAgcDriver.prx` was built with and without #9188 and #9202; nothing else differs. Two 600 s runs per side, alternating, with the same scripted input and `APS5_PROFILE_DRAW=1`: | | without #9188 and #9202 | with both | |---|---|---| | MGS1 opening and codec, presents per 10 s | 38 to 74 | 168 to 190 | | average synchronous draw | 17.7 to 27.1 ms (one window 76 ms) | 4.6 to 7.4 ms in the opening and codec, 1.3 to 2.1 ms at the Dock | | codec line "The Codec's receiver directly stimulates the small bones of your ear." | at 440 s and 538 s | at 183 s and 204 s | | Dock gameplay, radar on screen | not reached in 600 s (both runs) | at 237 s and 268 s | No run stopped. The second run with both changes was slower at the Dock (107 to 147 presents per 10 s, against 124 to 196 in the first). These runs held only this PC's GPU lock, so other work on the PC may have slowed it. The title's progress is tracked in its bring-up discussion, #9615. **Other GPUs, from reviewers:** @simnJS, GeForce RTX 4080 SUPER, driver 616.92, Windows 11 Pro 26200, on the earlier head `40e6e9247` (before the one-row case): - `agc_driver_linear_target_scissor_rows` passes 3 of 3. - With `main`'s `Draw.cpp` it fails 3 of 3 with the same partial-scissor message. - The other 11 tests pass 3 of 3 on both. @jotitadev, Ubuntu 26.04, NVIDIA GeForce RTX 3070 (driver 595.99.02) and lavapipe (Mesa 26.0.3), on the earlier head `eab9f18d2` on `main` `0c6a5bd59` (the rebase to `c01f5cb9c8` only moved the band fields into `TargetBinding`): - `agc_driver_linear_target_scissor_rows` passes 3 of 3 on both. - With `main`'s `Draw.cpp` and only this PR's test it fails on both with the same partial-scissor message. **Not tested:** AMD GPUs other than the RX 6700 XT, AMD on Linux. ### 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] Fixes: none - [x] Unblocks: none - [x] GPUs tested: AMD Radeon RX 6700 XT (gfx1031), AMD Windows drivers 32.0.21045.5002 and 32.0.21045.16010, Windows 11 26200; NVIDIA GeForce RTX 4080 SUPER, driver 616.92, Windows 11 (simnJS, earlier head); NVIDIA GeForce RTX 3070, driver 595.99.02, and lavapipe (Mesa 26.0.3), Ubuntu 26.04 (jotitadev, earlier head) - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
simnJS commented 2026-10-21 16:28:14 +00:00 (Migrated from github.com)

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


NVIDIA, Windows. GeForce RTX 4080 SUPER, driver 616.92 (32.0.16.1692), Windows 11 Pro 26200, Ryzen 9 7950X3D, WinLibs GCC 15.2.0 r7, Release.
Head 40e6e9247 on main cecb540a6.

ANYPS5_GPU=NVIDIA ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1, ctest --test-dir build -R "^(agc_driver_linear_target_scissor_rows|agc_driver_uint8x4_color_target_no_resident|agc_driver_color1555_target|agc_driver_color565_target|agc_driver_packed_float_color_target|agc_driver_packed_unorm_color_target|agc_driver_packed_mip_tail_target|agc_driver_pixel32_ar_export|agc_driver_pixel_uint16_export|agc_driver_pixel_ancillary_word|agc_driver_pixel_fixed_point_position|agc_driver_linear_target_resident)$" --output-on-failure --timeout 120 --repeat until-fail:3 -V.

Selected GPU name=NVIDIA GeForce RTX 4080 SUPER vendor=0x10de device=0x2702 subgroup=32 appears in all 36 test runs. No test skipped.

test with PR main Draw.cpp + PR test
agc_driver_linear_target_scissor_rows 3/3 (0.40, 0.32, 0.32 s) 0/3 (0.32, 0.31, 0.31 s): partial scissor: pixel (2, 2) outside the scissor holds byte 255 at 0, expected 17 (the CPU stored it while the draw ran)
agc_driver_uint8x4_color_target_no_resident 3/3 (0.43, 0.34, 0.34 s) 3/3 (0.34, 0.33, 0.34 s)
agc_driver_color1555_target 3/3 (0.49, 0.33, 0.34 s) 3/3 (0.38, 0.33, 0.33 s)
agc_driver_color565_target 3/3 (0.49, 0.36, 0.36 s) 3/3 (0.37, 0.36, 0.35 s)
agc_driver_packed_float_color_target 3/3 (0.49, 0.34, 0.33 s) 3/3 (0.33, 0.33, 0.34 s)
agc_driver_packed_unorm_color_target 3/3 (0.50, 0.33, 0.33 s) 3/3 (0.34, 0.31, 0.32 s)
agc_driver_packed_mip_tail_target 3/3 (0.49, 0.39, 0.38 s) 3/3 (0.39, 0.39, 0.39 s)
agc_driver_pixel32_ar_export 3/3 (0.41, 0.32, 0.32 s) 3/3 (0.32, 0.31, 0.31 s)
agc_driver_pixel_uint16_export 3/3 (0.42, 0.32, 0.32 s) 3/3 (0.32, 0.33, 0.33 s)
agc_driver_pixel_ancillary_word 3/3 (0.39, 0.31, 0.31 s) 3/3 (0.31, 0.31, 0.33 s)
agc_driver_pixel_fixed_point_position 3/3 (0.39, 0.31, 0.31 s) 3/3 (0.32, 0.31, 0.31 s)
agc_driver_linear_target_resident 3/3 (0.40, 0.30, 0.31 s) 3/3 (0.33, 0.30, 0.30 s)

Khronos validation layer not run: the Vulkan SDK is not installed on this machine.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6321017624 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9202#issuecomment-6321017624). Originally posted by [simnJS](https://github.com/simnJS) on 2026-10-21T16:28:14Z. --- NVIDIA, Windows. GeForce RTX 4080 SUPER, driver 616.92 (32.0.16.1692), Windows 11 Pro 26200, Ryzen 9 7950X3D, WinLibs GCC 15.2.0 r7, Release. Head `40e6e9247` on `main` `cecb540a6`. `ANYPS5_GPU=NVIDIA ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1`, `ctest --test-dir build -R "^(agc_driver_linear_target_scissor_rows|agc_driver_uint8x4_color_target_no_resident|agc_driver_color1555_target|agc_driver_color565_target|agc_driver_packed_float_color_target|agc_driver_packed_unorm_color_target|agc_driver_packed_mip_tail_target|agc_driver_pixel32_ar_export|agc_driver_pixel_uint16_export|agc_driver_pixel_ancillary_word|agc_driver_pixel_fixed_point_position|agc_driver_linear_target_resident)$" --output-on-failure --timeout 120 --repeat until-fail:3 -V`. `Selected GPU name=NVIDIA GeForce RTX 4080 SUPER vendor=0x10de device=0x2702 subgroup=32` appears in all 36 test runs. No test skipped. | test | with PR | main `Draw.cpp` + PR test | |---|---|---| | `agc_driver_linear_target_scissor_rows` | 3/3 (0.40, 0.32, 0.32 s) | 0/3 (0.32, 0.31, 0.31 s): `partial scissor: pixel (2, 2) outside the scissor holds byte 255 at 0, expected 17 (the CPU stored it while the draw ran)` | | `agc_driver_uint8x4_color_target_no_resident` | 3/3 (0.43, 0.34, 0.34 s) | 3/3 (0.34, 0.33, 0.34 s) | | `agc_driver_color1555_target` | 3/3 (0.49, 0.33, 0.34 s) | 3/3 (0.38, 0.33, 0.33 s) | | `agc_driver_color565_target` | 3/3 (0.49, 0.36, 0.36 s) | 3/3 (0.37, 0.36, 0.35 s) | | `agc_driver_packed_float_color_target` | 3/3 (0.49, 0.34, 0.33 s) | 3/3 (0.33, 0.33, 0.34 s) | | `agc_driver_packed_unorm_color_target` | 3/3 (0.50, 0.33, 0.33 s) | 3/3 (0.34, 0.31, 0.32 s) | | `agc_driver_packed_mip_tail_target` | 3/3 (0.49, 0.39, 0.38 s) | 3/3 (0.39, 0.39, 0.39 s) | | `agc_driver_pixel32_ar_export` | 3/3 (0.41, 0.32, 0.32 s) | 3/3 (0.32, 0.31, 0.31 s) | | `agc_driver_pixel_uint16_export` | 3/3 (0.42, 0.32, 0.32 s) | 3/3 (0.32, 0.33, 0.33 s) | | `agc_driver_pixel_ancillary_word` | 3/3 (0.39, 0.31, 0.31 s) | 3/3 (0.31, 0.31, 0.33 s) | | `agc_driver_pixel_fixed_point_position` | 3/3 (0.39, 0.31, 0.31 s) | 3/3 (0.32, 0.31, 0.31 s) | | `agc_driver_linear_target_resident` | 3/3 (0.40, 0.30, 0.31 s) | 3/3 (0.33, 0.30, 0.30 s) | Khronos validation layer not run: the Vulkan SDK is not installed on this machine. AI-assisted: yes
jotitadev commented 2026-10-21 21:56:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-21T21:56:33Z.

Review: COMMENTED


A Linux run on NVIDIA and lavapipe, with the red control, at the current head.

Machine: Ubuntu 26.04, i7-8700, GCC 15.2, Release, BUILD_TESTING=ON, every execution test built. NVIDIA GeForce RTX 3070 (driver 595.99.02) and lavapipe (Mesa 26.0.3, LLVM 21.1.8) on the same host. Head eab9f18d2 applied onto main 0c6a5bd59 (3-way, clean). ANYPS5_NO_SHADER_CACHE=1, -j1 --timeout 60 --repeat until-fail:3.

agc_driver_linear_target_scissor_rows RTX 3070 lavapipe
this PR pass, 3/3 (0.40, 0.32, 0.32 s) pass, 3/3 (0.27, 0.25, 0.24 s)
main Draw.cpp + only this PR's test fail fail

The red control fails the same way on both:

AGC graphics: partial scissor: pixel (2, 2) outside the scissor holds byte 255 at 0, expected 17 (the CPU stored it while the draw ran)

So on NVIDIA and on software Vulkan the whole-target store of a partial-scissor synchronous draw loses a concurrent guest CPU store, and this change fixes it; the test's position, out-of-scissor and both-CPU-store checks all hold with the PR.

(The earlier NVIDIA Windows run in the thread was on head 40e6e9247, which has since been force-pushed away; this is the current head eab9f18d2.)

Not run: Windows, AMD, the Khronos validation layer (not installed on this host), any title, performance.

GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02, Linux) and lavapipe (Mesa 26.0.3), Ubuntu 26.04

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5606736281 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9202#pullrequestreview-5606736281). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-21T21:56:33Z. **Review:** COMMENTED --- A Linux run on NVIDIA and lavapipe, with the red control, at the current head. **Machine:** Ubuntu 26.04, i7-8700, GCC 15.2, Release, `BUILD_TESTING=ON`, every execution test built. NVIDIA GeForce RTX 3070 (driver 595.99.02) and lavapipe (Mesa 26.0.3, LLVM 21.1.8) on the same host. Head `eab9f18d2` applied onto `main` `0c6a5bd59` (3-way, clean). `ANYPS5_NO_SHADER_CACHE=1`, `-j1 --timeout 60 --repeat until-fail:3`. | `agc_driver_linear_target_scissor_rows` | RTX 3070 | lavapipe | |---|---|---| | this PR | pass, 3/3 (0.40, 0.32, 0.32 s) | pass, 3/3 (0.27, 0.25, 0.24 s) | | `main` `Draw.cpp` + only this PR's test | fail | fail | The red control fails the same way on both: ``` AGC graphics: partial scissor: pixel (2, 2) outside the scissor holds byte 255 at 0, expected 17 (the CPU stored it while the draw ran) ``` So on NVIDIA and on software Vulkan the whole-target store of a partial-scissor synchronous draw loses a concurrent guest CPU store, and this change fixes it; the test's position, out-of-scissor and both-CPU-store checks all hold with the PR. (The earlier NVIDIA Windows run in the thread was on head `40e6e9247`, which has since been force-pushed away; this is the current head `eab9f18d2`.) Not run: Windows, AMD, the Khronos validation layer (not installed on this host), any title, performance. GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02, Linux) and lavapipe (Mesa 26.0.3), Ubuntu 26.04 Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
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!9202
No description provided.