fix(agc): include the host stage in the CMASK clear's host-access barriers #6781

Merged
XairRrR merged 1 commit from upstream-pr/6781 into main 2026-10-19 10:45:53 +00:00
XairRrR commented 2026-10-16 11:32:36 +00:00 (Migrated from github.com)

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


What

TextureDetiler::DispatchCmaskClear makes earlier host writes available with a source stage of VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, and makes its results visible to host reads with a destination stage of ALL_COMMANDS. ALL_COMMANDS does not include the host stage, so the host access bits in those barriers are unsupported by their stage masks (VUID-vkCmdPipelineBarrier-srcAccessMask-02815, VUID-vkCmdPipelineBarrier-dstAccessMask-02816) and the host side of the dependency is not formed. Both barriers now add VK_PIPELINE_STAGE_HOST_BIT, as the CMASK fill barrier right after them already does.

Tested

  • Built and tested on main at 3f171d03e; rebased onto aff725bf6, where main itself does not build here (PipelineJournal.cpp static assertions on ShaderStages and MeshConfiguration), which this change does not touch.
  • Linux (Arch, kernel 7.2.9), RTX 4070 Ti SUPER, driver 615.78.08.
  • agc_driver_cmask_fast_clear under VK_LAYER_KHRONOS_validation: 38 reports of 02815/02816 on main, none with this change; the test passes.
  • agc_driver_graphics passes.
  • Found by running Uncharted: Legacy of Thieves Collection (PPSA05684, #4001) under the validation layer.

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: none
  • GPUs tested: NVIDIA RTX 4070 Ti SUPER, driver 615.78.08, Linux
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4887747941 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6781). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-16T11:32:36Z. --- ### What `TextureDetiler::DispatchCmaskClear` makes earlier host writes available with a source stage of `VK_PIPELINE_STAGE_ALL_COMMANDS_BIT`, and makes its results visible to host reads with a destination stage of `ALL_COMMANDS`. `ALL_COMMANDS` does not include the host stage, so the host access bits in those barriers are unsupported by their stage masks (`VUID-vkCmdPipelineBarrier-srcAccessMask-02815`, `VUID-vkCmdPipelineBarrier-dstAccessMask-02816`) and the host side of the dependency is not formed. Both barriers now add `VK_PIPELINE_STAGE_HOST_BIT`, as the CMASK fill barrier right after them already does. ### Tested - Built and tested on `main` at 3f171d03e; rebased onto aff725bf6, where `main` itself does not build here (`PipelineJournal.cpp` static assertions on `ShaderStages` and `MeshConfiguration`), which this change does not touch. - Linux (Arch, kernel 7.2.9), RTX 4070 Ti SUPER, driver 615.78.08. - `agc_driver_cmask_fast_clear` under `VK_LAYER_KHRONOS_validation`: 38 reports of 02815/02816 on `main`, none with this change; the test passes. - `agc_driver_graphics` passes. - Found by running Uncharted: Legacy of Thieves Collection (PPSA05684, #4001) under the validation layer. ### 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: none - [x] GPUs tested: NVIDIA RTX 4070 Ti SUPER, driver 615.78.08, Linux - [x] AI-assisted: yes
MarcZX10 commented 2026-10-16 11:36:28 +00:00 (Migrated from github.com)

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

Review: APPROVED


Reviewed the two stage-mask changes. The barriers include HOST alongside ALL_COMMANDS exactly where their access masks include host accesses, while the existing compute/transfer dependencies remain intact. The validation-layer report and focused test results support the fix; I found no blocking issue.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5547235367 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6781#pullrequestreview-5547235367). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T11:36:28Z. **Review:** APPROVED --- Reviewed the two stage-mask changes. The barriers include HOST alongside ALL_COMMANDS exactly where their access masks include host accesses, while the existing compute/transfer dependencies remain intact. The validation-layer report and focused test results support the fix; I found no blocking issue.
github-actions[bot] commented 2026-10-16 11:47:18 +00:00 (Migrated from github.com)

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


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 5499 core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp
PR 6977 core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6214815913 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6781#issuecomment-6214815913). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-16T11:47:18Z. --- <!-- 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 5499](https://www.github.com/boykopovar/AnyPS5/pull/5499) | `core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp` | | [PR 6977](https://www.github.com/boykopovar/AnyPS5/pull/6977) | `core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp` |
adriadam10 commented 2026-10-19 10:46:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T10:46:51Z.


Checked both barriers: the host access bits in the access masks now have VK_PIPELINE_STAGE_HOST_BIT in the matching stage mask, consistent with the fill barrier right after them, and the compute dependencies are unchanged. Approved by @MarcZX10 as well; merged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6265429932 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6781#issuecomment-6265429932). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-19T10:46:51Z. --- Checked both barriers: the host access bits in the access masks now have `VK_PIPELINE_STAGE_HOST_BIT` in the matching stage mask, consistent with the fill barrier right after them, and the compute dependencies are unchanged. Approved by @MarcZX10 as well; 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!6781
No description provided.