Repository navigation
perf(agc): fill the device proc table before objects copy the context - #853
Conversation
|
Thanks. Filling the table earlier looks exact to me: Two things:
|
b7c78ea to
7ef0d4c
Compare
|
Dropped both comment blocks and force-pushed. Measured alone, the page goes from 85.6 to 82.9 ms per frame, ahead in all three interleaved rounds, and the per-draw |
|
I ran Ghost of Yōtei (PPSA26344 v1.008) for an hour with this PR (7ef0d4c) and In the open world it came to about 19 lookups per dispatch, against about 25 in our previous run without the PR. Up to the world, through the intro, it was about 23 per dispatch in both runs. I had expected it to drop close to zero once the table is filled before the caches and the recorder copy the context, so something else still resolves device functions inside device calls. I haven't looked into which calls those are. I didn't see any regression from the PR either: no Vulkan error and no FATAL in the hour. If it helps, I can rerun with a trace of the names being looked up, if you point me at the place you'd hook it. DetailsWindows 11, RTX 3080 Laptop. With the PR: our integration tree on main c8a2f06 + this PR at 7ef0d4c. Without: the previous integration build. The counter is cumulative, so the world numbers are deltas between the first line after the world loads and the last line of the run. With the PR (world from 412 s; 4.86 M lookups over 255 k dispatches = 19.1): Without it (world from 790 s; 3.06 M lookups over 122 k dispatches = 25.0): |
What
VulkanDevicefilled itsDeviceFunctionstable only after creating the buffer pool, pipeline cache, detiler, texture cache, color transfer, descriptor cache and recorder. Each of those keeps its own copy of theGraphics::Context, so their copies have no table and look every entry point up by name throughvkGetDeviceProcAddron each call, for examplevkAllocateDescriptorSetsfor every draw's descriptor sets.FillDeviceFunctionsonly needs the device andvkGetDeviceProcAddr, so the table is now filled right after the command pool, before any of those objects is made. The cached context is still built after the recorder, as before.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.
Measured alone on Sonic Origins Plus's heaviest menu page (about 1,650 draws per frame), as asked. The base is
mainat this PR's base (5895ea7) plus the commits my branch needs to boot this title and to sample it (a launcher script, the title's boot fixes, the process sampler; none of them are in this PR), against the same base with this commit on top. Three interleaved rounds, each the median of six FPS readings:About 2.7 ms per frame, ahead in every round. In a 15 s profile of the page,
Context::Functionlooking upvkAllocateDescriptorSetsby name (the loader'svkGetDeviceProcAddrunder it) took 22 of 2,553 AGC worker samples (0.9%) on the base and none with this PR. The loader's whole share of the worker went from 1.18% to 0.53%; what is left comes fromBuildVertexInputLayout.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)