Move b3Quickprof.* from Bullet 3.x src folder to btgui/Timing

The Bullet 3.x B3_PROFILE can be customized using b3SetCustomEnterProfileZoneFunc/b3SetCustomLeaveProfileZoneFunc defined in Bullet3Common/b3Logging,
so you can hook Bullet 3.x up to your profiler of choice.
The Demos3/BasicGpuDemo will show the Bullet 3.x timings inside the Bullet 2.x btQuickprof profiler.
This commit is contained in:
erwin coumans
2013-06-19 22:08:03 -07:00
parent 6acf4d03a7
commit a69ba48de4
35 changed files with 138 additions and 915 deletions

View File

@@ -182,6 +182,10 @@ BasicGpuDemo::~BasicGpuDemo()
void BasicGpuDemo::initPhysics()
{
//use the Bullet 2.x btQuickprof for profiling of Bullet 3.x
b3SetCustomEnterProfileZoneFunc(CProfileManager::Start_Profile);
b3SetCustomLeaveProfileZoneFunc(CProfileManager::Stop_Profile);
setTexturing(true);
setShadows(false);//too slow with many objects

View File

@@ -19,7 +19,6 @@ static char* particleKernelsString =
#include "GpuDemoInternalData.h"
#include "Bullet3Common/b3Quickprof.h"
//1000000 particles
//#define NUM_PARTICLES_X 100

View File

@@ -1,5 +1,4 @@
#include "PairBench.h"
#include "Bullet3Common/b3Quickprof.h"
#include "OpenGLWindow/ShapeData.h"
#include "OpenGLWindow/GLInstancingRenderer.h"
#include "Bullet3Common/b3Quaternion.h"
@@ -10,6 +9,7 @@
#include "OpenGLWindow/OpenGLInclude.h"
#include "OpenGLWindow/GLInstanceRendererInternalData.h"
#include "Bullet3OpenCL/ParallelPrimitives/b3LauncherCL.h"
#include "../../../btgui/Timing/b3Quickprof.h"
static b3KeyboardCallback oldCallback = 0;
extern bool gReset;
@@ -172,7 +172,10 @@ void PairBench::initPhysics(const ConstructionInfo& ci)
m_instancingRenderer = ci.m_instancingRenderer;
#ifndef B3_NO_PROFILE
b3ProfileManager::CleanupMemory();
#endif //B3_NO_PROFILE
int strideInBytes = 9*sizeof(float);
int numVertices = sizeof(cube_vertices)/strideInBytes;
int numIndices = sizeof(cube_vertices)/sizeof(int);

View File

@@ -21,7 +21,6 @@
#include "OpenGLWindow/GLPrimitiveRenderer.h"
#include "OpenGLWindow/GLInstancingRenderer.h"
//#include "OpenGL3CoreRenderer.h"
#include "Bullet3Common/b3Quickprof.h"
//#include "b3GpuDynamicsWorld.h"
#include <assert.h>
#include <string.h>
@@ -37,6 +36,9 @@
#include "rigidbody/GpuSphereScene.h"
#include "rigidbody/Bullet2FileDemo.h"
#include "softbody/GpuSoftBodyDemo.h"
#include "../btgui/Timing/b3Quickprof.h"
//#include "BroadphaseBenchmark.h"
@@ -412,6 +414,10 @@ int main(int argc, char* argv[])
{
//b3OpenCLUtils::setCachePath("/Users/erwincoumans/develop/mycache");
b3SetCustomEnterProfileZoneFunc(b3ProfileManager::Start_Profile);
b3SetCustomLeaveProfileZoneFunc(b3ProfileManager::Stop_Profile);
b3SetCustomPrintfFunc(myprintf);
b3Vector3 test(1,2,3);
test.x = 1;
@@ -456,7 +462,7 @@ int main(int argc, char* argv[])
#ifndef B3_NO_PROFILE
#ifndef B3_NO_PROFILE
b3ProfileManager::Reset();
#endif //B3_NO_PROFILE

View File

@@ -63,6 +63,10 @@ function createProject(vendor)
"../../btgui/FontFiles/OpenSans.cpp",
"../../btgui/stb_image/stb_image.cpp",
"../../btgui/stb_image/stb_image.h",
"../../btgui/Timing/b3Quickprof.cpp",
"../../btgui/Timing/b3Quickprof.h",
"../../btgui/Timing/b3Clock.cpp",
"../../btgui/Timing/b3Clock.h",
}
if os.is("Windows") then

View File

@@ -19,7 +19,6 @@ extern bool enableExperimentalCpuConcaveCollision;
#include "OpenGLWindow/GLInstancingRenderer.h"
//#include "LinearMath/b3Quickprof.h"
#include "Bullet3Common/b3Quaternion.h"
#include "Bullet3Common/b3Matrix3x3.h"
#include "Bullet3OpenCL/NarrowphaseCollision/b3ConvexUtility.h"

View File

@@ -1,6 +1,5 @@
#include "ConcaveScene.h"
#include "GpuRigidBodyDemo.h"
#include "Bullet3Common/b3Quickprof.h"
#include "OpenGLWindow/ShapeData.h"
#include "OpenGLWindow/GLInstancingRenderer.h"

View File

@@ -1,6 +1,5 @@
#include "GpuCompoundScene.h"
#include "GpuRigidBodyDemo.h"
#include "Bullet3Common/b3Quickprof.h"
#include "OpenGLWindow/ShapeData.h"
#include "OpenGLWindow/GLInstancingRenderer.h"

View File

@@ -1,6 +1,5 @@
#include "GpuConvexScene.h"
#include "GpuRigidBodyDemo.h"
#include "Bullet3Common/b3Quickprof.h"
#include "OpenGLWindow/ShapeData.h"
#include "OpenGLWindow/GLInstancingRenderer.h"

View File

@@ -1,5 +1,4 @@
#include "GpuRigidBodyDemo.h"
#include "Bullet3Common/b3Quickprof.h"
#include "OpenGLWindow/ShapeData.h"
#include "OpenGLWindow/GLInstancingRenderer.h"
#include "Bullet3Common/b3Quaternion.h"

View File

@@ -1,6 +1,5 @@
#include "GpuSphereScene.h"
#include "GpuRigidBodyDemo.h"
#include "Bullet3Common/b3Quickprof.h"
#include "OpenGLWindow/ShapeData.h"
#include "OpenGLWindow/GLInstancingRenderer.h"
#include "Bullet3Common/b3Quaternion.h"

View File

@@ -1,5 +1,4 @@
#include "GpuSoftBodyDemo.h"
#include "Bullet3Common/b3Quickprof.h"
#include "OpenGLWindow/ShapeData.h"
#include "OpenGLWindow/GLInstancingRenderer.h"
#include "Bullet3Common/b3Quaternion.h"

View File

@@ -11,7 +11,6 @@
#include "OpenGLWindow/GLPrimitiveRenderer.h"
#include "OpenGLWindow/GLInstancingRenderer.h"
//#include "OpenGL3CoreRenderer.h"
#include "Bullet3Common/b3Quickprof.h"
//#include "b3GpuDynamicsWorld.h"
#include <assert.h>
#include <string.h>
@@ -19,7 +18,7 @@
#include "OpenGLTrueTypeFont/opengl_fontstashcallbacks.h"
#include "OpenGLWindow/GwenOpenGL3CoreRenderer.h"
#include "../btgui/Timing/b3Quickprof.h"
#include "Gwen/Gwen.h"
#include "Gwen/Controls/Button.h"

View File

@@ -49,10 +49,12 @@ function createProject(vendor)
"../../src/Bullet3Geometry/b3ConvexHullComputer.cpp",
"../../src/Bullet3Geometry/b3ConvexHullComputer.h",
"../../src/Bullet3Common/b3AlignedAllocator.cpp",
"../../src/Bullet3Common/b3Quickprof.cpp",
"../../src/Bullet3Common/b3Quickprof.h",
"../../src/Bullet3Common/b3Logging.cpp",
"../../src/Bullet3Common/b3Logging.h",
"../../src/Bullet3Common/b3logging.cpp",
"../../src/Bullet3Common/b3logging.h",
"../../btgui/Timing/b3Quickprof.cpp",
"../../btgui/Timing/b3Quickprof.h",
"../../btgui/Timing/b3Clock.cpp",
"../../btgui/Timing/b3Clock.h",
}