fix(agc): rasterize nothing for an attachment-free draw with an empty screen scissor #6773

Merged
XairRrR merged 1 commit from upstream-pr/6773 into main 2026-10-20 09:14:17 +00:00
XairRrR commented 2026-10-16 11:22:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-16T11:22:54Z.


What

A draw without color or depth targets takes its framebuffer extent from PA_SC_SCREEN_SCISSOR_BR. When that rectangle is empty (0 in Legacy of Thieves Collection's case, about a minute after its menu), DecodeState threw empty framebuffer extent for a draw without color writes and the title stopped.

An empty screen scissor rasterizes no pixels; the vertex stage still runs. The framebuffer is now one pixel in each empty dimension and the screen scissor clips it to nothing, the same way a collapsed viewport already gets an empty scissor.

#6212 treats an inverted scissor rectangle as empty; this is the attachment-free case of an empty screen scissor, which that PR does not touch.

Tested

  • Linux (Arch, kernel 7.2.9), RTX 4070 Ti SUPER, driver 615.78.08.
  • agc_driver_graphics: the attachment-free state with PA_SC_SCREEN_SCISSOR_BR = 0 decodes to a 1x1 framebuffer with an empty scissor; a screen scissor of 64 columns and no rows keeps its width and clips every row.
  • Uncharted: Legacy of Thieves Collection (PPSA05684, #4001): the draw no longer stops the title.

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: PPSA05684 #4001
  • GPUs tested: NVIDIA RTX 4070 Ti SUPER, driver 615.78.08, Linux
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4887646845 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6773). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-16T11:22:54Z. --- ### What A draw without color or depth targets takes its framebuffer extent from `PA_SC_SCREEN_SCISSOR_BR`. When that rectangle is empty (`0` in Legacy of Thieves Collection's case, about a minute after its menu), `DecodeState` threw `empty framebuffer extent for a draw without color writes` and the title stopped. An empty screen scissor rasterizes no pixels; the vertex stage still runs. The framebuffer is now one pixel in each empty dimension and the screen scissor clips it to nothing, the same way a collapsed viewport already gets an empty scissor. #6212 treats an inverted scissor rectangle as empty; this is the attachment-free case of an empty screen scissor, which that PR does not touch. ### Tested - Linux (Arch, kernel 7.2.9), RTX 4070 Ti SUPER, driver 615.78.08. - `agc_driver_graphics`: the attachment-free state with `PA_SC_SCREEN_SCISSOR_BR = 0` decodes to a 1x1 framebuffer with an empty scissor; a screen scissor of 64 columns and no rows keeps its width and clips every row. - Uncharted: Legacy of Thieves Collection (PPSA05684, #4001): the draw no longer stops the title. ### Checklist - [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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical 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: PPSA05684 #4001 - [x] GPUs tested: NVIDIA RTX 4070 Ti SUPER, driver 615.78.08, Linux - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-16 11:31:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-16T11:31:30Z.


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 4040 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
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
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
PR 6146 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6194 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6235 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6280 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6481 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6548 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6636 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6683 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6808 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6970 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6972 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6977 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 7085 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7332 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7668 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7862 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7948 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 8099 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6214549476 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6773#issuecomment-6214549476). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-16T11:31:30Z. --- <!-- pr-overlap --> 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 4040](https://www.github.com/boykopovar/AnyPS5/pull/4040) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [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` | | [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` | | [PR 6146](https://www.github.com/boykopovar/AnyPS5/pull/6146) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [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 6194](https://www.github.com/boykopovar/AnyPS5/pull/6194) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [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 6280](https://www.github.com/boykopovar/AnyPS5/pull/6280) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6481](https://www.github.com/boykopovar/AnyPS5/pull/6481) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6548](https://www.github.com/boykopovar/AnyPS5/pull/6548) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6636](https://www.github.com/boykopovar/AnyPS5/pull/6636) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6683](https://www.github.com/boykopovar/AnyPS5/pull/6683) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6808](https://www.github.com/boykopovar/AnyPS5/pull/6808) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6970](https://www.github.com/boykopovar/AnyPS5/pull/6970) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6972](https://www.github.com/boykopovar/AnyPS5/pull/6972) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6977](https://www.github.com/boykopovar/AnyPS5/pull/6977) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp` | | [PR 7085](https://www.github.com/boykopovar/AnyPS5/pull/7085) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 7256](https://www.github.com/boykopovar/AnyPS5/pull/7256) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 7668](https://www.github.com/boykopovar/AnyPS5/pull/7668) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 7862](https://www.github.com/boykopovar/AnyPS5/pull/7862) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 7948](https://www.github.com/boykopovar/AnyPS5/pull/7948) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp` | | [PR 8099](https://www.github.com/boykopovar/AnyPS5/pull/8099) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` |
MarcZX10 commented 2026-10-16 11:52:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T11:52:19Z.

Review: APPROVED


The fallback keeps the attachment-free framebuffer extent nonzero while intersecting the original screen scissor to an empty rectangle, so the draw can run without rasterizing fragments. The decode tests cover both a fully empty rectangle and a zero-height rectangle with a nonzero width, and the reported game run confirms the original stop is gone. The PR is mergeable and its eligibility, conventions, intake, and report checks pass.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5547397781 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6773#pullrequestreview-5547397781). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T11:52:19Z. **Review:** APPROVED --- The fallback keeps the attachment-free framebuffer extent nonzero while intersecting the original screen scissor to an empty rectangle, so the draw can run without rasterizing fragments. The decode tests cover both a fully empty rectangle and a zero-height rectangle with a nonzero width, and the reported game run confirms the original stop is gone. The PR is mergeable and its eligibility, conventions, intake, and report checks pass.
savvaniss commented 2026-10-17 14:43:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-17T14:43:22Z.


Intel and AMD Windows data: no failures from this change.

Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built, ANYPS5_NO_SHADER_CACHE=1, serial CTest, main 47a266cf9. Intel UHD Graphics 770 (8086:a780, 32-wide subgroups), driver 32.0.101.7088. AMD Radeon RX 9070 XT (1002:7550, 64-wide subgroups), driver 32.0.31041.1004, with VkCache emptied first.

UHD 770 RX 9070 XT
This head 3659e9a99 merged into main: the 16 tests built from tests/Graphics.cpp, ×3 pass pass

Full CTest (--parallel 4) with six open PRs merged into main (#6638, #6604, #6014, #6773, #6772, #6725): the same failures as main alone on both GPUs, nothing new. main alone: UHD 770 1392 of 1398, RX 9070 XT 1396 of 1398. The failures are image tables (#6647) and sample_multisample_target (#6971) on Intel, and quad_pixel_mask (#6255) and layered_volume_vertex_no_gpl (#4768) on AMD.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6235239833 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6773#issuecomment-6235239833). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-17T14:43:22Z. --- Intel and AMD Windows data: no failures from this change. Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built, `ANYPS5_NO_SHADER_CACHE=1`, serial CTest, `main` `47a266cf9`. Intel UHD Graphics 770 (`8086:a780`, 32-wide subgroups), driver 32.0.101.7088. AMD Radeon RX 9070 XT (`1002:7550`, 64-wide subgroups), driver 32.0.31041.1004, with `VkCache` emptied first. | | UHD 770 | RX 9070 XT | |---|---|---| | This head `3659e9a99` merged into `main`: the 16 tests built from `tests/Graphics.cpp`, ×3 | pass | pass | Full CTest (`--parallel 4`) with six open PRs merged into `main` (#6638, #6604, #6014, #6773, #6772, #6725): the same failures as `main` alone on both GPUs, nothing new. `main` alone: UHD 770 1392 of 1398, RX 9070 XT 1396 of 1398. The failures are image tables (#6647) and `sample_multisample_target` (#6971) on Intel, and `quad_pixel_mask` (#6255) and `layered_volume_vertex_no_gpl` (#4768) on AMD. AI-assisted: yes (Claude Code)
adriadam10 commented 2026-10-20 09:14:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-20T09:14:47Z.


Checked the empty screen scissor path (intersect clips the 1x1 extent to 0x0) and the updated Graphics test against current main; merged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6287614756 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6773#issuecomment-6287614756). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-20T09:14:47Z. --- Checked the empty screen scissor path (intersect clips the 1x1 extent to 0x0) and the updated Graphics test against current main; merged.
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!6773
No description provided.