fix(agc): publish native depth before cached buffer recording #10492
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10492"
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 Ondra97 on 2026-10-24T03:23:35Z.
What
A writable buffer can become backed by a newly created native depth owner after its resource set was cached. If publication first occurs in
Bind, it may synchronize and end a command buffer the cached dispatch already acquired. RunrequireGuestBuffers()inRevalidateafter registered-image identity validation and before every resource proof, including the epoch shortcut, so publication/refusal completes before cached recording.The November 11 integration used main
bc94a8e423ea026aadbb29165fed1ad2db471154. The carried #9950 publisher retains Ethan Barr's authorship and matches #10469's refreshed production implementation, including main's snapshot/readback helpers, overwritten-plane proofs and colour-alias retirement. #10469 and #10492 remain independent after #9950. The three cached-publication fixture functions remain byte-identical to the previous submission, retaining import-watch skips and explicit driver shutdown. All new main test registrations are preserved alongside this PR's three modes.The confirmed order remains #9950, then #10469/#10492, then #10497, then #7002. The #7002 author confirmation retains the early transition before epoch proof and the deferred feedback scan before either colour/depth publication pass. #7002 remains draft; its combined colour stack is not qualified here.
The November 19 main sync carries the shared D32 publication update from #10469. Main's reuse policy remains in place. The cached resource guard still runs before the epoch proof, and repeated staging uploads retain the transfer-write dependency.
Tested
The November 19 Windows Release retest used main
b68affac18ca39391a3800d5cb51735d085c014dand PR head804659939aebb28904cbc3e64146b33c4d6b364e. Both full runtime builds passed with WinLibs GCC 15.2.0. The same 31 focused Vulkan CTests passed on both revisions. All three PR-specific publication CTests passed, including cached draw recording and its buffer store. The RTX 4070 Ti SUPER on driver 621.24 and Khronos validation 1.4.335 were confirmed in every log. The runs logged no VUID or synchronization hazards. Two internal HTILE write-coverage assertions skipped on each revision.The separate #10469 plus #10492 merge preview conflicts in
NativeMultisampleDepth.cpp. The November 19 runs cover each PR's main-based revision independently. Earlier reports below apply to the revisions they list.November 11, 2026 (Europe/Prague): submitted head
ec6f18ac80329de04ed7e50a56c1bc76b87ceac8, based on mainbc94a8e423ea026aadbb29165fed1ad2db471154.Windows 11 Pro 10.0.26300; AMD Ryzen 9 7900X; 31.66 GiB RAM; NVIDIA GeForce RTX 4070 Ti SUPER, driver 621.01. WinLibs GCC 15.2.0 r7 UCRT, CMake 4.1.2, Ninja 1.13.2, Python 3.14.7. Release full-runtime configuration with
BUILD_TESTING=ONandANYPS5_ENABLE_SPIRV_TOOLS=ON. Production relinker, all libraries and the four focused fixture targets build successfully.The main comparison ran at
60ec4a7bcd05d6700c987adaabad19c2acd2142e; the only subsequent base change is in the unrelatedGuestNpCommonRuntime.cppfixture. Repository blobs for production code, dependencies, build scripts and the focused tests are identical between that baseline and the submitted base, so that baseline is reused. The submitted head was rebuilt and the entire selection rerun after the final rebase.Both arms require Vulkan, disable normal shader caches, enable
APS5_VERIFY_SHAPE_MEMO=1and use the same explicit Khronos validation 1.4.335 path and layer logging. The logs confirm the selected RTX 4070 Ti SUPER and matching inserted Khronos/OBS/Overwolf/NVIDIA layers. Neither log contains a missing requested layer, VUID, validation error or synchronization hazard. The single skip in each arm isagc_driver_native_depth_driver_queued_fill.All three added modes execute and pass: cached writable-buffer publication, the dispatch-items variant and cached draw publication with
APS5_DRAW_PIPELINE=1. The full selection also covers current D32S8 publication, overwritten-plane, single-sample-view and pending-unit cases. A source-order check confirms registered-image identity validation precedes publication, which precedes both epoch/full proofs. Conventions (one debt-length warning, zero errors), whitespace and strict main-sync checks pass.The 2,007-head depth overlap snapshot used for #10469 exited 2 because conflicting branches prevented complete comparisons. Its shared depth/debt diffs were manually inspected and reused for the byte-identical publisher. The added
Revalidatetransition was checked against current main and #7002's confirmed order; no clean full overlap result or combined colour/fault-slot stack is claimed. Existing contributor reports retain their original revision/platform scope. No full CTest or new title/console run is claimed.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-24T12:13:49Z.
Review: COMMENTED
I reviewed the cached-depth publication guard and the new GPU regression. The call at
ShaderResources::Revalidateentry is important because it runs before both the epoch shortcut and the full proof; thePrepareDrawBindingscheck also handles moved buffer addresses. The PR reports useful negative controls and validation-layer runs, though the hosted GPU/product jobs are skipped and I could not reproduce the RTX 4070 Ti SUPER run locally.One integration point should be agreed before these changes are composed: open #7002 changes the same
ShaderResourcescall sites fromrequireGuestBuffers()tosynchronizeGuestBuffers()and adds read-only buffer synchronization atRevalidate. Please coordinate the exact combined behavior and merge order with #7002’s author, so the early native-MSAA guard remains before the epoch proof while the read-only color synchronization is retained only where appropriate. The current body already calls this coordination out; the dependency checklist currently lists only #6498 and #9950.Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-31T00:06:18Z.
Review: COMMENTED
Linux run of head
d6589d3607. The three new tests behave differently from the RTX 4070 Ti / Windows run. There is a cause and a two-line test fix for the NVIDIA part.Setup: Ubuntu 26.04, GCC 15.2, Release. RTX 3070 (NVIDIA 595.99.02) and lavapipe (Mesa 26.0.3), one at a time via
VK_DRIVER_FILES.ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1,ctest -j1. The head merged--no-ffonto currentmainde96e3efbdwith no conflicts. The selection is the 7 tests ofagc_driver_native_multisample_depth_tests.native_depth_buffer_publicationand_buffer_publication_itemsabort (SIGABRT) after their checks pass, 3 of 3cached_draw_publicationfailsRTX 3070 abort: the device is destroyed at static destruction. The backtrace is
exit→Driver::~Driver→Driver::stop→DevicePointer::Reset→VulkanDevice::State::~State→abortinsidelibVkLayer_khronos_validation.so. The--buffer-publicationmode runs on the driver singleton's own device, and nothing takes that device back beforemainreturns. Its last reference therefore dies inDriver::~Driverduring static destruction, and the 1.4.341 layer aborts in that late device teardown. I couldn't symbolize the layer frame, so the exact check inside the layer is not confirmed. Moving the teardown beforemainreturns makes the abort go away (below).#13021's stack hit the same pattern in
CheckDriverPathand fixed it in53886418d9by stopping the driver before the test returns. The same change fixes it here:With that (I also added it to
--cached-draw-publication, which doesn't abort today), the three tests pass:VUID-lines;VkDeviceCreateInfo-pNext-pNext.lavapipe: the new modes need write-watched imports. All three fail with every layer setting, and with no layer:
lavapipe's probe reports
host imports resolve write protection: yes ... imported ranges are compared, so an imported range doesn't stay watched. The NVIDIA cards report "imported ranges stay watched". The fixture's HTILE cases already handle such a device withPrepareImportWatch(...) == ImportWatch::Unwatchand a skip, but these three modes have no such check. On a device with compared imports, they need the same handling or a skip (77). I described the same result on #10497, which carries these tests.GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02, Linux); lavapipe (Mesa 26.0.3, Linux).
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T09:30:13Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
804659939aebb28904cbc3e64146b33c4d6b364eusingrepo_read.py. No commands or tests were run by me; the Windows build and CTest results below are author-reported.Results
Findings
Blocking
None.
Non-blocking
Not verified
NativeMultisampleDepth.cpp.DepthSurface.cpp,GuestBufferMemory.cpp,ShaderResources.cpp,agc_driver_native_multisample_depth_tests.cmake, targeted changed hunks and contexts inNativeMultisampleDepth.cpp, and both changed debt documents. The two large source files were excluded fromfiles/by size and read through the pinned reader. No other changed files were excluded.To get this to a good state
Nothing is required. Optional: provide coverage for the two skipped HTILE write-coverage assertions.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T11:57:53Z.
Review: COMMENTED
Reviewed — no blocking findings
No blocking defect was verified in the inspected changes; checks for the exact head were not run.
What I ran
Reviewed head
b320672fb37241f90b7d54865627b8c388d3587busing the prepared diff andrepo_read.pyfor targeted source context. No build or tests were run. The description reports Windows Vulkan runs on a different PR head (804659939aebb28904cbc3e64146b33c4d6b364e).Results
Findings
Blocking
None verified in the inspected changes.
Non-blocking
None.
Not verified
The full contents of the large changed source and test files were not read; their changed lines and relevant code paths were inspected. Exact-head build, CTests, validation-layer output, and console behavior were not verified. The description reports skipped HTILE coverage assertions and a conflicting combined merge preview.
To get this to a good state
Nothing is required.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.