fix(agc): track imported draw inputs in render-pass hazards #4887
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4887"
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 Dripl1x on 2026-10-13T01:54:12Z.
What
Imported vertex and index buffers are listed in
DrawInputs::inPlaceReads, butrecordDrawomits them fromPassAccess. A draw that reads only these inputs can therefore look memory-free to the render-pass hazard tracker. Overlapping GPU writes can be classified as independent, allowing a pass to continue when it needs an ordering barrier.Pass these input reads as a separate borrowed span and include them in read-after-write, write-after-read and unknown-write checks.
PassHazards::Addretains the ranges, rather than the span. Existing callers default to an empty span. Disjoint and empty ranges retain their current behavior, and this avoids constructing another combined read vector for each draw.Related to #4649, which changes how pending GPU writes are ordered before imported vertex inputs. This PR contains only the hazard-tracking fix and applies independently to
main; it does not include that PR's optimization.Tested
Windows, NVIDIA GeForce RTX 3070 Laptop GPU, driver 617.42; WinLibs GCC 15.2.0, Release,
BUILD_TESTING=ON,ANYPS5_ENABLE_SPIRV_TOOLS=ON. Based on0c3dc9ca2b0572cf4239a3c16de3a8a3ba6f8304.Full root CMake build passed (
cmake --build build-gpu --parallel 12).Focused CTest run: 4/4 passed, 11.85 s total, with the normal 30 s timeout:
Negative control: compiling the new
agc_pass_hazardstests against the originalmainimplementation fails five checks; the fixed implementation passes. New cases cover overlapping reads/writes, input-only draws, unknown writes, retained shader-resource reads, disjoint and empty ranges, and unrelated images.Local Conventions checker, including the commit subject and PR description, and
git diff --checkpassed.The hazard regression is a CPU test. The imported-input and BDA tests use the NVIDIA Vulkan device; graphics tests also exercise mocked command recording. Windows host imports are compared rather than watched, so the imported-input test skips its kept-highest-index cache subsection. No PS5 title, rendered-frame comparison or game FPS measurement was performed, and no FPS improvement is claimed. Linux and the full CTest suite were not run locally. Independent Windows runs are reported in the comments: the full suite, 1023 of 1023, on an RTX 4070 Laptop GPU and an Intel Raptor Lake-S iGPU, and
agc_pass_hazardson an RTX 4080 SUPER.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T04:39:06Z.
Windows test (MinGW GCC 15.2, Release, Windows 10, RTX 4080 SUPER). Built on current main
3779597together with four other open GPU PRs (their own commits cherry-picked, no merge commits), so only the tests that belong to this PR say something about it:tests/PassHazards.cpp(agc_pass_hazards): 3 of 3 runs passed.Not tested: no game run. The batch was built once, not per PR; nothing failed, so no bisect was needed.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by kr4y4 on 2026-10-13T04:47:29Z.
The full suite, which the description lists as not run, on NVIDIA and Intel.
Setup: Windows 11 (26200), WinLibs GCC 15.2.0 r7, Release, CI configure flags, an RTX 4070 Laptop GPU and an Intel Raptor Lake-S iGPU. The head
03ea80c17merged intomain495bf91a0, which passes 1023 of 1023 on both GPUs.agc_pass_hazardspasses on both GPUs with--repeat until-fail:3.ctest --timeout 120 --parallel 4): 1023 of 1023 on both GPUs,agc_draw_inputs_in_place,agc_driver_graphicsandagc_driver_bda_deviceincluded.Written with AI assistance.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T02:32:51Z.
Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.
Pull request closed