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:
@@ -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
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ static char* particleKernelsString =
|
||||
#include "GpuDemoInternalData.h"
|
||||
|
||||
|
||||
#include "Bullet3Common/b3Quickprof.h"
|
||||
|
||||
//1000000 particles
|
||||
//#define NUM_PARTICLES_X 100
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "ConcaveScene.h"
|
||||
#include "GpuRigidBodyDemo.h"
|
||||
#include "Bullet3Common/b3Quickprof.h"
|
||||
#include "OpenGLWindow/ShapeData.h"
|
||||
|
||||
#include "OpenGLWindow/GLInstancingRenderer.h"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "GpuCompoundScene.h"
|
||||
#include "GpuRigidBodyDemo.h"
|
||||
#include "Bullet3Common/b3Quickprof.h"
|
||||
#include "OpenGLWindow/ShapeData.h"
|
||||
|
||||
#include "OpenGLWindow/GLInstancingRenderer.h"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "GpuConvexScene.h"
|
||||
#include "GpuRigidBodyDemo.h"
|
||||
#include "Bullet3Common/b3Quickprof.h"
|
||||
#include "OpenGLWindow/ShapeData.h"
|
||||
|
||||
#include "OpenGLWindow/GLInstancingRenderer.h"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "GpuRigidBodyDemo.h"
|
||||
#include "Bullet3Common/b3Quickprof.h"
|
||||
#include "OpenGLWindow/ShapeData.h"
|
||||
#include "OpenGLWindow/GLInstancingRenderer.h"
|
||||
#include "Bullet3Common/b3Quaternion.h"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "GpuSoftBodyDemo.h"
|
||||
#include "Bullet3Common/b3Quickprof.h"
|
||||
#include "OpenGLWindow/ShapeData.h"
|
||||
#include "OpenGLWindow/GLInstancingRenderer.h"
|
||||
#include "Bullet3Common/b3Quaternion.h"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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",
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user