You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(agc): drop the second validation of draw packets - #855
Pm4::ResolveDraw started with Validate(packet, 0). The worker only executes packets of submission.commands, the copy Driver::validate already accepted at submit and at the rewind tail, so the packet sizes ResolveDraw indexes are guaranteed by then. The call is removed; the checks ResolveDraw makes itself, the index range check included, stay.
Tested
Windows 11, MinGW GCC 15.2, RTX 2080 Ti. This branch builds, and the 165 agc driver, recompiler and execution test targets pass with it stacked on the other changes I'm sending (#849 and the perf PRs opened with this one). I haven't measured this change alone: together with 14 changes of the same kind on my working branch it took Sonic Origins Plus's heaviest menu page (about 1,650 draws per frame) from 48.0 to 43.6 ms per frame (20.8 to 22.9 FPS).
Checklist
Based on current main; no other open PR implements the same functions
Thanks. I checked that no throw path is lost. The only caller outside the tests is Driver::draw, which runs on submission.commands. copyCommands inlines the jumps into that buffer, and Driver::validate checks every packet in it with the real queue number, at submit and for the rewind tail. That check is stricter than the removed Validate(packet, 0). The ResolveDraw cases in tests/Pm4.cpp use well-formed packets, and the malformed ones go through Validate directly.
One thing before it can go in. Performance PRs need before/after numbers for the change itself (the owner asked for this on #218). The 48.0 to 43.6 ms figure is for 15 changes together. Could you measure main against main plus this PR alone on the same page? The mean frame time over a few runs is enough, or the Validate share of the AGC worker profile.
Measured alone as asked: over three interleaved rounds on the same page, the base and this PR average 11.70 and 11.60 FPS, within the noise, and Validate under ResolveDraw was only about 0.16% of the AGC worker's samples on the base (8 of 5,106 over two 15 s profiles, none with this PR). It doesn't help measurably on its own, so I'm closing it, as asked on #218.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Pm4::ResolveDrawstarted withValidate(packet, 0). The worker only executes packets ofsubmission.commands, the copyDriver::validatealready accepted at submit and at the rewind tail, so the packet sizes ResolveDraw indexes are guaranteed by then. The call is removed; the checks ResolveDraw makes itself, the index range check included, stay.Tested
Windows 11, MinGW GCC 15.2, RTX 2080 Ti. This branch builds, and the 165 agc driver, recompiler and execution test targets pass with it stacked on the other changes I'm sending (#849 and the perf PRs opened with this one). I haven't measured this change alone: together with 14 changes of the same kind on my working branch it took Sonic Origins Plus's heaviest menu page (about 1,650 draws per frame) from 48.0 to 43.6 ms per frame (20.8 to 22.9 FPS).
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)