Custom profiling of Cull/Draw operations #1233
-
Hello, Thank you for the fantastic framework. I am in a situation where I want to use Tracy in an OSG app. And I would like to add profile marks on cull and render operations. But those are started and ended in OSG code. So there is no scope where I can put my profile mark. I can profile individual cull operations as long as they are overriden by user code. But I can't profile the cull operation of the entire viewer. Is there a way I can have user code that encloses the start and end of Cull/Draw ? This is a context where they are done in a thread different from the main thread. Basically I would like to be able to make the same measures as the ones done by the OSG profiler. these ones in particular: So either have a function that calls the actual Cull/Draw functions from the viewer where I can put my scope. Or a callback that is called when a frame cull is started, and another one that is called when it is over, so I can trigger the start and end of a scope. The reason I want to be able to do this is because tracy offers a better visualization of nested scopes, that way it would be more easy for me to see which parts of the draw/cull operations are slow by profiling individual functions. But I also want to be able to get the more global measure to have it all in one place, the more detailed function profiling and the more high level "Cull" and "Draw" times. |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 1 reply
-
The osg::Stats class is what collects the frame/update/cull/draw/draw GPU times. I don't know if you could add anything around vsg::Stats. The other approach would be to use a update callback, cull and draw callbacks to add in the Tracy calls. |
Beta Was this translation helpful? Give feedback.
-
Is there any way I can make sure an update/cull/draw callback is either called first or last ? |
Beta Was this translation helpful? Give feedback.
-
node callbacks in the OSG have responsibility for traversal of the node's children so you can do timing on before traversing the subgraph and after, Look for examples that use callbacks and discussions about it to explain the approach. |
Beta Was this translation helpful? Give feedback.
-
Thank you! |
Beta Was this translation helpful? Give feedback.
-
If you care enough about performance optimization that you are thinking there is value in using Tracy then it might be that you should just move over to using the Vulkan/VulkanSceneGraph rather than OpenGL/OpenSceneGraph, this will likely give you the biggest improvement in performance you could get. |
Beta Was this translation helpful? Give feedback.
-
It's for openMW. So VSG is a long term goal, but something that will probably not happen in the near future. And because we are adding a lot of stuff from oblivion skyrim etc... I would like to have better profiling tools on a shorter timeframe. |
Beta Was this translation helpful? Give feedback.
-
Hi all,
I also try getting timing information from various cameras located inside the scene.
What I do is:
_camera->setStats(myOsgStats);
_camera->setNodeMask(0xffffffff);
_camera->setFinalDrawCallback(new Cl_3D_FinalDrawStatsCallback(_camera));
The callback collects the attributes times and prints them out.
Unfortunately they are all 0.0
Obviously the camera doesn't recognize the presence of the Stats instance and thus doesn't collect anything.
What am I missing to get it work?
Thanks
Werner
Am 31.05.2023 um 09:53 schrieb Robert Osfield:
…
node callbacks in the OSG have responsibility for traversal of the node's children so you can do timing on before traversing the subgraph and after, Look for examples that use
callbacks and discussions about it to explain the approach.
—
Reply to this email directly, view it on GitHub <#1233 (comment)>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A4NEOA72R3QYR4K3MRO4ZRDXI32GXANCNFSM6AAAAAAYUVB4JQ>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
node callbacks in the OSG have responsibility for traversal of the node's children so you can do timing on before traversing the subgraph and after, Look for examples that use callbacks and discussions about it to explain the approach.