Repository navigation
perf(agc): drop the redundant structurize pre-check at registration - #2327
Conversation
|
Tested on Linux (CachyOS x86_64, Intel RPL-S iGPU / Mesa 26.3.0-devel / Vulkan 1.4.363, GCC 16.2.1) at
LGTM! |
|
Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head
No title was run. 🤖 Addressed by Claude Code |
|
Needs a rebase: |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9bc9729 to
d8ae88c
Compare
|
Rebased onto current Build + ctest of libSceAgcDriver on the rebased head: 304/304. The Ronin timing in the description was taken with the decode also removed, so the saving on Merging once CI is green. |
What
PrepareRegistereddecodes the shader, builds its control-flow graph and structurizes it, then throws the graph away. Next,ShaderRecompiler::PrepareShader→PrepareResourceProgramdecodes, builds and structurizes the same code again with the sameSwappcInfo. Every registered shader therefore goes throughGraphBuilder::Build+Structurizer::Structurizeonce more than needed. mrk1987 counted threeStructurizepasses per shader on #2105; this removes one of them.The removed pass only did one thing: throw early. Any exception it raised is raised again from
PrepareShaderfor the same code, so a shader that failed registration before still fails it, with the same message.No title stops on this; it is a load-time cost. On
mainthe registration path runs for every shader a title registers, so I measured it on a title that registers many.Tested
Linux (CachyOS, GCC, Release), Ryzen 7 7800X3D, RX 9070 XT, RADV / Mesa 26.2.4.
cteston this branch (rebased onmaind70b899): 512 of 513 pass. The failure isimport_audit(source_commitisNonebecause my build tree is a git worktree), unrelated to this change.shader_cachedeleted before each run), headless gamescope at 1920×1080. Ronin does not get far onmainalone, so these runs use a local stack of open PRs onmain43972e6 (fix(agc): defer shaders that cannot be prepared at registration to their first use #1836's first version, fix(agc): accept bound copies of a registered shader header that differ only in user_data #1837, fix(agc): prepare the null pixel program at draw when its variant was not prepared #1902, fix(agc): prepare a rect-list draw's missing rectangle at draw from its prepared stages #1928, perf(recompiler): compute post-dominators visiting successors first #2105 and others). The only difference between A and B is this commit. Both runs stop at the same later point,prepared shader artifact is missing for the requested static ABI … stage=1, which is unrelated to this PR. I time from launch to that stop:The shaders compiled are the same in both: 804–809 cache misses in the first 10 s, about 850 in total.
Overlap
#1836 adds its deferral check in
PrepareRegisteredright before the removedGraphBuilder::Buildline. Whichever merges second needs a small rebase. Nothing else changes.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)PrepareRegistered, see Overlap)🤖 Generated with Claude Code