fix(agc): publish small tiled writes before labels #11694
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11694"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by droid2299 on 2026-10-27T03:30:55Z.
What
Publish small tiled storage-image write-backs directly to the host import instead of a unit shadow. This keeps their results visible to CPU reads after a label, while large tiled images retain unit-shadow write-backs.
Adds a focused regression test covering CPU visibility after a label, GPU-reader ordering, and the large-image shadow path.
Tested
Windows 10 Home 25H2 (build 26200.9711), NVIDIA GeForce RTX 4070 Laptop GPU, NVIDIA driver 616.92 (32.0.16.1692), Release.
cmake --build build-main-regression --target agc_driver_recorder_tests --parallelANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build-main-regression -R '^agc_small_tiled_shadow_label$' -VVUID-errors.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T05:23:30Z.
Review: CHANGES_REQUESTED
Reviewed exact head
ce2c64a2b68957ba9f9a8b75cb999de5bddcd937.[P1] Preserve neighboring unit-shadow data when small write-backs bypass the shadow. In
StorageTexture::writeBackWindows, this change forcesShadowDestinationForto return no destination for every write at or belowSmallStoreBytes, so those pieces are copied directly into the host import. Shadow freshness is tracked per 64 KiB unit. A small 4 KiB-swizzled image can share that unit with a different image whose newer bytes are still in a shadow slab; the direct import write/MarkWrittenpath can invalidate the unit and discard the neighbor's unpublished bytes. I do not see aPublishShadowof the affected unit before the direct copy.The current regression uses a 64 KiB-aligned image with no shadowed neighbor, so it cannot catch this case. Please add the requested shared-unit regression (4 KiB-swizzled small image plus a shadowed neighbor), verify the small image remains CPU-visible after the label and the neighbor's contents survive publication, and preserve the large-image shadow control. Publishing the affected partial units before a direct write, or keeping the existing shadow path and publishing the small image at readback time, are possible approaches; the test should establish the correct behavior.
Hosted eligibility, intake, conventions, label and report checks pass; product jobs are skipped by path policy. The PR reports a focused Windows/Vulkan validation-layer run, which I have not independently reproduced on this host.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T09:42:12Z.
Review: DISMISSED
Follow-up against current upstream
main801d5b9bc1: this PR remains based on09f9a63f6b, andTexture.cpp, the driver CMake file andRecorder.cppall changed on main since then. The currentTexture.cppalso changed storage-view format handling and theStorageViewinterface, so the earlier review cannot establish behavior or build/test coverage for the current merge. Please rebase and rerun the paired small-image/neighbor shadow regression, large-image shadow control, and the required Vulkan validation-layer test on the merged tree. The previous shared-64-KiB-unit concern remains unresolved; the stale-base integration request is an additional reason not to approve.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-27T11:35:09Z.
Review: CHANGES_REQUESTED
Thanks for the fix; the label case in #11481 is real. Points to address:
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:3418: forcing no shadow destination for every write at or belowSmallStoreBytessends those pieces straight to the host import. Shadow freshness is tracked per 64 KiB unit, so a small image with a 256 B / 4 KiB swizzle that shares a unit with another image's still-shadowed results discards that neighbour's unpublished bytes on the direct write plusMarkWritten. Either publish the affected units (PublishShadow(range, PublishScope::PartialUnits, ...), asstoreDrawnRectand the whole-layer path do) before the direct copy, or keep write-back unchanged and haveStoreReadbackBeforeLabelpublish shadowed units over the small ranges.core/libs/prx/libSceAgcDriver/tests/Recorder.cpp:5888: the test uses a 64 KiB-aligned image with no neighbour, so it cannot catch the case above. Please add a 4 KiB-swizzled small image sharing a unit with a shadowed neighbour, checking that the small image is CPU-visible after the label and the neighbour's contents survive. Keep the large-image shadow control.main;Texture.cpp, the driver CMake file andRecorder.cpphave changed since. Please rebase and rerun the focused tests withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1and the validation layer on the merged tree.Happy to look again once these are addressed.