Move ChromeTracing in its own file, and add tracing support for VR server (App_SharedMemoryPhysics_VR)

Add a bit of extra sleep in PhysicsServer thread, to make rendering smoother.
This commit is contained in:
erwincoumans
2017-01-29 20:59:47 -08:00
parent 446cb77a5e
commit 26a34e3cda
11 changed files with 333 additions and 266 deletions

View File

@@ -11,6 +11,7 @@
#include "Bullet3Common/b3CommandLineArgs.h"
#include "../Utils/b3Clock.h"
#include "../Utils/ChromeTraceUtil.h"
#include "../ExampleBrowser/OpenGLGuiHelper.h"
#include "../CommonInterfaces/CommonExampleInterface.h"
#include "../CommonInterfaces/CommonGUIHelperInterface.h"
@@ -344,6 +345,17 @@ b3KeyboardCallback prevKeyboardCallback = 0;
void MyKeyboardCallback(int key, int state)
{
if (key == 'p')
{
if (state)
{
b3ChromeUtilsStartTimings();
}
else
{
b3ChromeUtilsStopTimingsAndWriteJsonFile();
}
}
if (sExample)
{
sExample->keyboardCallback(key,state);
@@ -794,6 +806,7 @@ void CMainApplication::RunMainLoop()
while ( !bQuit && !m_app->m_window->requestedExit())
{
b3ChromeUtilsEnableProfiling();
{
B3_PROFILE("main");
@@ -2241,6 +2254,12 @@ int main(int argc, char *argv[])
{
gDisableDesktopGL = true;
}
if (args.CheckCmdLineFlag("tracing"))
{
b3ChromeUtilsStartTimings();
b3ChromeUtilsEnableProfiling();
}
#ifdef BT_USE_CUSTOM_PROFILER
b3SetCustomEnterProfileZoneFunc(dcEnter);
@@ -2280,8 +2299,11 @@ int main(int argc, char *argv[])
pMainApplication->Shutdown();
#ifdef BT_USE_CUSTOM_PROFILER
#endif
if (args.CheckCmdLineFlag("tracing"))
{
b3ChromeUtilsStopTimingsAndWriteJsonFile();
}
return 0;
}