fix(agc): bind a strided buffer's last record only up to the render target it runs into #8224

Merged
savvaniss merged 2 commits from upstream-pr/8224 into main 2026-10-21 08:32:49 +00:00
savvaniss commented 2026-10-20 04:34:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-20T04:34:12Z.


What

A vertex fetch often gets one buffer descriptor per attribute, with its base at the attribute's offset inside the vertex and the vertex size as stride. Such a descriptor's stride * num_records therefore ends up to one stride past the bytes the fetch reads, by the attribute's offset. When the buffer sits right before the current render target, that tail runs a few bytes into the target, and the draw stopped with "shader buffer aliases the render target" although no read reaches the target. In Boggle (CUSA03312) a 4-vertex buffer of stride 60 ended 8 bytes into the 1920x1088 target that follows it in memory.

A strided buffer that starts below the render target and runs less than one stride into it is now bound only up to the target. This is the rule the allocation bound from #2912 already applies when the next allocation starts there, with the same assumption: the tail is the part of the last record no fetch reads. The build check (ShaderResources::addGuestBuffer) and the check repeated for a cached build (CheckBufferAliases) apply it alike. A buffer that runs a whole stride or more into the target still fails. The strided-overhang debt entry records the rule.

Tested

Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, on main 32e88ad847.

  • agc_driver_graphics has two new cases in its alias checks: a stride-60, 4-record V# that ends 8 bytes into the render target is accepted, and one that ends 60 bytes into it is still refused. On main's code the first case fails ("shader buffer aliases the render target"); with the change both pass.

  • agc_driver, agc_driver_native_msaa_vertex_input and agc_driver_sample_multisample_target pass on main and with the change on the RX 9070 XT. On the UHD 770, agc_driver_sample_multisample_target fails at its sample-store check on both, as on main (#6957, fix in #6971).

  • Validation layer: those four tests on main and on this branch, on both GPUs, with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation: no VUID- line in any log. Neither log contains was not found but was requested by env var VK_INSTANCE_LAYERS, and each log's Selected GPU line names the GPU of its run.

  • Boggle (CUSA03312), on #6977's branch with local changes for its PS4 render targets: starting a round stopped at the alias above. With this change it shuffles the dice and plays a round, and the traced words show on the board.

  • tools/check_conventions.py --base origin/main passes.

  • 21 Oct, after review: the trim applies only to read-only buffers (!written in addGuestBuffer and CheckBufferAliases). A written strided V# that runs 8 bytes into the render target still fails as an alias. agc_driver_graphics gains that case and marks the accepted case read-only. Without the !written check, it fails with "expected graphics rejection: aliases the render target"; with it, it passes, with this branch merged onto main b77bd5880. The debt entry now says read-only.

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: CUSA03312 #7198
  • GPUs tested: AMD Radeon RX 9070 XT (driver 32.0.31041.1004) and Intel UHD Graphics 770 (driver 32.0.101.7088), Windows 11 Pro 26300
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4931051795 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8224). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-20T04:34:12Z. --- ### What A vertex fetch often gets one buffer descriptor per attribute, with its base at the attribute's offset inside the vertex and the vertex size as stride. Such a descriptor's `stride * num_records` therefore ends up to one stride past the bytes the fetch reads, by the attribute's offset. When the buffer sits right before the current render target, that tail runs a few bytes into the target, and the draw stopped with "shader buffer aliases the render target" although no read reaches the target. In Boggle (CUSA03312) a 4-vertex buffer of stride 60 ended 8 bytes into the 1920x1088 target that follows it in memory. A strided buffer that starts below the render target and runs less than one stride into it is now bound only up to the target. This is the rule the allocation bound from #2912 already applies when the next allocation starts there, with the same assumption: the tail is the part of the last record no fetch reads. The build check (`ShaderResources::addGuestBuffer`) and the check repeated for a cached build (`CheckBufferAliases`) apply it alike. A buffer that runs a whole stride or more into the target still fails. The strided-overhang debt entry records the rule. ### Tested Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, on `main` 32e88ad847. - `agc_driver_graphics` has two new cases in its alias checks: a stride-60, 4-record V# that ends 8 bytes into the render target is accepted, and one that ends 60 bytes into it is still refused. On `main`'s code the first case fails ("shader buffer aliases the render target"); with the change both pass. - `agc_driver`, `agc_driver_native_msaa_vertex_input` and `agc_driver_sample_multisample_target` pass on `main` and with the change on the RX 9070 XT. On the UHD 770, `agc_driver_sample_multisample_target` fails at its sample-store check on both, as on `main` (#6957, fix in #6971). - Validation layer: those four tests on `main` and on this branch, on both GPUs, with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1` and `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`: no `VUID-` line in any log. Neither log contains `was not found but was requested by env var VK_INSTANCE_LAYERS`, and each log's `Selected GPU` line names the GPU of its run. - Boggle (CUSA03312), on #6977's branch with local changes for its PS4 render targets: starting a round stopped at the alias above. With this change it shuffles the dice and plays a round, and the traced words show on the board. - `tools/check_conventions.py --base origin/main` passes. - 21 Oct, after review: the trim applies only to read-only buffers (`!written` in `addGuestBuffer` and `CheckBufferAliases`). A written strided V# that runs 8 bytes into the render target still fails as an alias. `agc_driver_graphics` gains that case and marks the accepted case read-only. Without the `!written` check, it fails with "expected graphics rejection: aliases the render target"; with it, it passes, with this branch merged onto `main` `b77bd5880`. The debt entry now says read-only. ### 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: CUSA03312 #7198 - [x] GPUs tested: AMD Radeon RX 9070 XT (driver 32.0.31041.1004) and Intel UHD Graphics 770 (driver 32.0.101.7088), Windows 11 Pro 26300 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-20 04:41:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T04:41:48Z.


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 6636 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp L806
PR 8971 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp L806

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/Draw.cpp
PR 1368 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 1395 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.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 4072 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 4448 docs/dev/debt/libSceAgcDriver.md
PR 4449 docs/dev/debt/libSceAgcDriver.md
PR 5058 docs/dev/debt/libSceAgcDriver.md
PR 5372 docs/dev/debt/libSceAgcDriver.md
PR 5431 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 5441 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5499 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 5925 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6188 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6192 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6194 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6202 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6223 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6235 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6280 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6300 docs/dev/debt/libSceAgcDriver.md
PR 6412 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6481 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6539 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6548 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6808 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6867 docs/dev/debt/libSceAgcDriver.md
PR 6868 docs/dev/debt/libSceAgcDriver.md
PR 6946 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6947 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6977 docs/dev/debt/libSceAgcDriver.md
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7410 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7449 docs/dev/debt/libSceAgcDriver.md
PR 7484 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 7505 docs/dev/debt/libSceAgcDriver.md
PR 7604 docs/dev/debt/libSceAgcDriver.md
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7689 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 7800 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7831 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 8014 docs/dev/debt/libSceAgcDriver.md
PR 8246 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 8564 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 8592 docs/dev/debt/libSceAgcDriver.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6283545247 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8224#issuecomment-6283545247). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-20T04:41:48Z. --- <!-- 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 6636](https://www.github.com/boykopovar/AnyPS5/pull/6636) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` [L806](https://github.com/boykopovar/AnyPS5/blob/f894ba69d30055259a56907563f438379d1275a3/core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp#L806) | | | | [PR 8971](https://www.github.com/boykopovar/AnyPS5/pull/8971) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` [L806](https://github.com/boykopovar/AnyPS5/blob/f894ba69d30055259a56907563f438379d1275a3/core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp#L806) | | | 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/Draw.cpp` | | [PR 1368](https://www.github.com/boykopovar/AnyPS5/pull/1368) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 1395](https://www.github.com/boykopovar/AnyPS5/pull/1395) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.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 4072](https://www.github.com/boykopovar/AnyPS5/pull/4072) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 4448](https://www.github.com/boykopovar/AnyPS5/pull/4448) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 4449](https://www.github.com/boykopovar/AnyPS5/pull/4449) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5058](https://www.github.com/boykopovar/AnyPS5/pull/5058) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5372](https://www.github.com/boykopovar/AnyPS5/pull/5372) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5431](https://www.github.com/boykopovar/AnyPS5/pull/5431) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 5441](https://www.github.com/boykopovar/AnyPS5/pull/5441) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 5499](https://www.github.com/boykopovar/AnyPS5/pull/5499) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 5609](https://www.github.com/boykopovar/AnyPS5/pull/5609) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`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/Draw.cpp` | | [PR 6192](https://www.github.com/boykopovar/AnyPS5/pull/6192) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6194](https://www.github.com/boykopovar/AnyPS5/pull/6194) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6202](https://www.github.com/boykopovar/AnyPS5/pull/6202) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6223](https://www.github.com/boykopovar/AnyPS5/pull/6223) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6235](https://www.github.com/boykopovar/AnyPS5/pull/6235) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6280](https://www.github.com/boykopovar/AnyPS5/pull/6280) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6300](https://www.github.com/boykopovar/AnyPS5/pull/6300) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6412](https://www.github.com/boykopovar/AnyPS5/pull/6412) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6481](https://www.github.com/boykopovar/AnyPS5/pull/6481) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6539](https://www.github.com/boykopovar/AnyPS5/pull/6539) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.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 6808](https://www.github.com/boykopovar/AnyPS5/pull/6808) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6867](https://www.github.com/boykopovar/AnyPS5/pull/6867) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6868](https://www.github.com/boykopovar/AnyPS5/pull/6868) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6977](https://www.github.com/boykopovar/AnyPS5/pull/6977) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7256](https://www.github.com/boykopovar/AnyPS5/pull/7256) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 7410](https://www.github.com/boykopovar/AnyPS5/pull/7410) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 7449](https://www.github.com/boykopovar/AnyPS5/pull/7449) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7484](https://www.github.com/boykopovar/AnyPS5/pull/7484) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 7505](https://www.github.com/boykopovar/AnyPS5/pull/7505) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7604](https://www.github.com/boykopovar/AnyPS5/pull/7604) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 7689](https://www.github.com/boykopovar/AnyPS5/pull/7689) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 7800](https://www.github.com/boykopovar/AnyPS5/pull/7800) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 7831](https://www.github.com/boykopovar/AnyPS5/pull/7831) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 8014](https://www.github.com/boykopovar/AnyPS5/pull/8014) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 8246](https://www.github.com/boykopovar/AnyPS5/pull/8246) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 8564](https://www.github.com/boykopovar/AnyPS5/pull/8564) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 8592](https://www.github.com/boykopovar/AnyPS5/pull/8592) | `docs/dev/debt/libSceAgcDriver.md` |
janzezno commented 2026-10-20 21:25:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by janzezno on 2026-10-20T21:25:13Z.


Linux run on AMD; the Tested section covers Windows only.

Host: Arch Linux, kernel 7.2.11, AMD Radeon RX 7900 GRE (RADV NAVI31), Mesa 26.2.5, GCC 16.2.1, Release, BUILD_TESTING=ON.
main ca74ef217; PR head 9d659c509 applied on top.

  • ctest --test-dir build -R '^agc_driver_graphics$' --repeat until-fail:3: 1 of 1 pass, 3 repeats, as on main. These tests do not open a Vulkan device.
  • Full suite, ctest -j12: no new failures. The three that fail also fail on main on this machine: agc_driver_guest_memory_lifetime (#7849), agc_driver_image_array_window_past_layer_limit (#8361) and agc_driver_tessellation (Mesa, #5444).
  • agc_driver_pixel_interlock and agc_driver_sgpr_pattern_fill_keys also failed in the first full run; both pass 3 of 3 rerun with the PR and fail intermittently on main under ctest -j12 here.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6301820152 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8224#issuecomment-6301820152). Originally posted by [janzezno](https://github.com/janzezno) on 2026-10-20T21:25:13Z. --- Linux run on AMD; the Tested section covers Windows only. Host: Arch Linux, kernel 7.2.11, AMD Radeon RX 7900 GRE (RADV NAVI31), Mesa 26.2.5, GCC 16.2.1, Release, `BUILD_TESTING=ON`. `main` `ca74ef217`; PR head `9d659c509` applied on top. - `ctest --test-dir build -R '^agc_driver_graphics$' --repeat until-fail:3`: 1 of 1 pass, 3 repeats, as on `main`. These tests do not open a Vulkan device. - Full suite, `ctest -j12`: no new failures. The three that fail also fail on `main` on this machine: `agc_driver_guest_memory_lifetime` (#7849), `agc_driver_image_array_window_past_layer_limit` (#8361) and `agc_driver_tessellation` (Mesa, #5444). - `agc_driver_pixel_interlock` and `agc_driver_sgpr_pattern_fill_keys` also failed in the first full run; both pass 3 of 3 rerun with the PR and fail intermittently on `main` under `ctest -j12` here.
oneandonlydean commented 2026-10-21 01:45:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T01:45:40Z.


@savvaniss thanks, the rule fits the per-attribute vertex fetch case: the overhang is the attribute offset, so the trimmed range never drops a byte a fetch reads.

One question: the trim also applies when the buffer is written (written is known in both addGuestBuffer and CheckBufferAliases). For a store, the reasoning "no fetch reads the tail" doesn't carry over: a strided RW buffer whose last record runs into the render target would now be bound short, and stores to those bytes would be dropped instead of failing as an alias. Could the trim be limited to read-only buffers (!written && in both conditions)? The case in your description is a vertex fetch, so it should still pass.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6305959709 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8224#issuecomment-6305959709). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-21T01:45:40Z. --- @savvaniss thanks, the rule fits the per-attribute vertex fetch case: the overhang is the attribute offset, so the trimmed range never drops a byte a fetch reads. One question: the trim also applies when the buffer is written (`written` is known in both `addGuestBuffer` and `CheckBufferAliases`). For a store, the reasoning "no fetch reads the tail" doesn't carry over: a strided RW buffer whose last record runs into the render target would now be bound short, and stores to those bytes would be dropped instead of failing as an alias. Could the trim be limited to read-only buffers (`!written &&` in both conditions)? The case in your description is a vertex fetch, so it should still pass.
savvaniss commented 2026-10-21 07:15:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-21T07:15:40Z.


@oneandonlydean agreed, and done in 1c0e23afc. Both conditions now start with !written, so a written strided buffer whose last record runs into the render target is bound in full and fails as an alias, as before.

  • agc_driver_graphics marks the accepted case read-only. A new case, the same V# marked written, must still fail with "aliases the render target".
  • With the !written check removed, the test fails with "expected graphics rejection: aliases the render target". With it, the test passes, with the branch merged onto main b77bd5880.
  • The debt entry now says read-only.

@janzezno thank you for the Linux AMD run.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6310334843 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8224#issuecomment-6310334843). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-21T07:15:40Z. --- @oneandonlydean agreed, and done in `1c0e23afc`. Both conditions now start with `!written`, so a written strided buffer whose last record runs into the render target is bound in full and fails as an alias, as before. - `agc_driver_graphics` marks the accepted case read-only. A new case, the same V# marked written, must still fail with "aliases the render target". - With the `!written` check removed, the test fails with "expected graphics rejection: aliases the render target". With it, the test passes, with the branch merged onto `main` `b77bd5880`. - The debt entry now says read-only. @janzezno thank you for the Linux AMD run. AI-assisted: yes (Claude Code)
oneandonlydean commented 2026-10-21 07:24:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T07:24:47Z.


@savvaniss thanks, checked on 1c0e23afc: both trims (Draw.cpp and ShaderResources.cpp) now require !written, and the new written case fails with "aliases the render target". Next is a full CI run on this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6310481488 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8224#issuecomment-6310481488). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-21T07:24:47Z. --- @savvaniss thanks, checked on `1c0e23afc`: both trims (`Draw.cpp` and `ShaderResources.cpp`) now require `!written`, and the new written case fails with "aliases the render target". Next is a full CI run on this head.
EagleBearerYS commented 2026-10-21 10:55:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-21T10:55:02Z.


@savvaniss, a follow-up to this PR: #9050 makes the moved-buffer check of a cached build (MovedReadOnlyBuffers) cut a read-only buffer at the render target the way addGuestBuffer and CheckBufferAliases now do. Without it, a cached build holding such a buffer compares the cut size it bound with the descriptor's whole size, so it takes the buffer as moved on every hit: the hit either rebinds all of it over the render target or the draw builds again. The follow-up has a test next to your alias cases. Review welcome.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6314215139 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8224#issuecomment-6314215139). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-21T10:55:02Z. --- @savvaniss, a follow-up to this PR: #9050 makes the moved-buffer check of a cached build (`MovedReadOnlyBuffers`) cut a read-only buffer at the render target the way `addGuestBuffer` and `CheckBufferAliases` now do. Without it, a cached build holding such a buffer compares the cut size it bound with the descriptor's whole size, so it takes the buffer as moved on every hit: the hit either rebinds all of it over the render target or the draw builds again. The follow-up has a test next to your alias cases. Review welcome.
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!8224
No description provided.