fix(agc): mark a draw's validate, index and vertex trace stages where they end #14857
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14857"
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 JJenkx on 2026-11-01T20:43:29Z.
What
Graphics::Draw's trace stages put the time of the index and vertex uploads undervalidate.prepareDrawmarkedvalidateonly afterprepareDrawInputshad returned. That function does three things:The code then marked
index_uploadimmediately aftervalidate, soindex_uploadwas always zero-length and never appeared in the trace. In a Goat Simulator 3 (PPSA04158) trace onmain8f55414024,Graphics.Draw.validatetotals 1057 ms over the 4 s window, about 50 ms per frame, andGraphics.Draw.index_uploadhas no events.prepareDrawInputsnow receives the draw'sPerformanceTimerand marks each stage where itsDrawTimerphase ends:validateatPhaseValidate;index_uploadwhen index validation ends;vertex_uploadstage atPhaseVertex.The recipe path (
Graphics.DrawWithRecipe) gets the same split. Before this change it recorded onlydraw_and_resource_release. A draw that returns withinputs.nothingafter completing validation now recordsvalidatebefore returning; it records no index or vertex upload stages for work it does not perform.No behaviour change outside the trace: the draw does the same work in the same order.
Tested
Windows 11 (10.0.22621), AMD Ryzen 9 5950X, AMD Radeon RX 6700 XT, AMD proprietary driver 26.10.1, GCC 15.2.0 UCRT r7, Release.
Goat Simulator 3 (PPSA04158), 3840x2160. Same scripted pad input,
APS5_TRACE_SECONDS=600:4, and no other trace or profile switch. Draw-stage totals over the 4 s window:Graphics.Drawvalidateindex_uploadvertex_uploaddraw_and_resource_releasemain8f55414024, run 1main8f55414024, run 2620449652emain, the time labelledvalidateis almost all vertex upload: about 160 µs per draw that uploads vertices. Validation itself is negligible.mainruns (186 ms and 239 ms).mainruns. The rebase onto currentmaine0caf13600applied with no conflicts and was rebuilt.Registered tests. On the rebased branch,
ctest -R "^agc_.*(draw|perf|trace)"passes 89/89. On67b98fb4af, the full AGC Vulkan GPU suite with VVL 1.4.363 gives 830/831. The one failure,agc_driver_sample_order_grid_reference, also fails onmainon this machine. The VUID set is identical tomain.Later Linux qualification: main
0580e5c951a8d436af2976a3f86a980c798ef5c2and same main plus this PR (34af4558ba68d5ae80caae14ffc2b0d941852da1) each passed the same 89 focused draw/performance/trace tests, with zero skips or VUID IDs and actual Khronos layer insertion on RX 6650 XT / RADV Mesa 26.2.6. Pinned paired evidence; no Linux title trace or speed claim.Not run: macOS; other titles.
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 BunnyFl on 2026-11-02T01:27:28Z.
Review: APPROVED
Windows 11, WinLibs GCC 15.2.0 r7, Release, AMD Radeon RX 9070 XT (driver 32.0.32015.7029), Vulkan SDK 1.4.363 validation layer. Head
019e4e00ebmerged into upstream/main93dbd0f82a, and main93dbd0f82a, built the same way. Same tests on both, withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest -V:agc_driver_graphicsagc_driver_draw_offset_indicesagc_driver_pixel_ancillary_wordNeither log contains the missing-layer message, and neither has any
VUID-orSYNC-HAZARDID. The built library contains theindex_uploadandvertex_uploadstage names. I didn't capture a title trace, so the stage split itself is checked by reading only.Read against main: both callers now pass the timer, and the two marks
prepareDrawmade afterprepareDrawInputsreturned are gone, so nothing is marked twice. One difference worth stating in the PR: the recipe path (prepareDrawInputs(..., &recipe), ~Draw.cpp:3787) made no marks before. Its validate, index and vertex time now appears under those stages too, instead of under whatever stage came next. Also, a draw that returns early withinputs.nothingafter validation now records avalidatemark. Both seem like what you want.