Integrate optick profiler#262
Conversation
|
Still some solution-side work to do so the buildbot will work, from the look of it - unsurprising, will investigate later. |
|
This should be good to go now; I've extended the buildbot to deal in git submodules, and made some preprocessor definitions that were previously done by hand in my local checkout. Profiling backend is now selected by the Since profiling has a runtime performance overhead (nominal in As-is, developers needing to profile can locally modify Exposing this via a new Exposing it dynamically via cvar might also be worth considering, but that would add a conditional branch to the top of every instrumented function. May or may not be worth the tradeoff; would need to be tested. Maybe concerning for compiler optimization of tight loops / other hot codepaths. (Also it looks like I forgot to mark this as draft in the first place? Whoops...) |
|
I think the best solution would be new |
|
ProfiledDX11 configuration commit |
|
Alrihgt, kinda fixed it, at least it compiles xrPhysics dont have Profiling yet, Link error when trying to use Profiled config on that project, so it uses Release config |
Based on the IX-Ray implementation by @ForserX
Summary of changes
Add
optick-gitsubmodule, expose to solution viaoptickVS sub-projectRemove old xrGame
profiler.h/profiler.cppSTART_PROFILE/END_PROFILEwrappersImplement xrCore
profiler.hwrapping optick macrosAdd
xrCoreto appropriate include paths, normalize relativeprofiler.hincludesInstrument main loop in
device.cppon_idleHook
spawn_threadinto profiler machineryPROF_THREADin every thread callsiteInstrument various
device.cppfunctions and some downstream callsitesUsage
Locally modify
profiler.hor the solution's preprocessor definitions to setXRCORE_PROFILERto1(PROFILER_OPTICK) before creating your development build.After reaching the title screen, Optick's standalone client will be able to attach to it and gather profiling data.
Further work
Increase profiling coverage by instrumenting more callsites with
PROF_EVENT,START_PROFILE/STOP_PROFILEas the need arisesAllow profiling of before-main-loop code
Console commands to manually start / stop profile recording at runtime, save
.optfiles for offline loadingHook into xrCPU_Pipe to visualize worker threads
Optick API
Closing notes
Opening as draft for now, as I need to figure out an appropriate solution to runtime overhead; as-is, the new preprocessor define is set on all project configurations, and exhibits noticeable overhead when running
VerifiedDX11. I'll testDX11AVXand think on it some, but suggestions would be most welcome 👍