Test for btCudaBroadphase added
This commit is contained in:
@@ -24,6 +24,8 @@ subject to the following restrictions:
|
||||
#include "btBulletCollisionCommon.h"
|
||||
#include "BulletCollision/BroadphaseCollision/btDbvtBroadphase.h"
|
||||
#include "Camera.h"
|
||||
#include "../CUDA/btCudaBroadphase.h"
|
||||
#include "LinearMath/btQuickprof.h"
|
||||
|
||||
int numParts =2;
|
||||
|
||||
@@ -34,6 +36,8 @@ bool enableOcclusion = false;
|
||||
bool showOcclusion = true;
|
||||
int visiblecount = 0;
|
||||
|
||||
static bool sBulletProfilerToggle = false;
|
||||
|
||||
struct OcclusionBuffer
|
||||
{
|
||||
struct WriteOCL
|
||||
@@ -419,6 +423,16 @@ BulletSAPCompleteBoxPruningTest::BulletSAPCompleteBoxPruningTest(int numBoxes,in
|
||||
methodname = "dynamic AABB tree, btDbvtBroadphase";
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
// m_broadphase = new btAxisSweep3(aabbMin,aabbMax,maxNumBoxes);
|
||||
// m_broadphase = new btSimpleBroadphase(maxNumBoxes,new btSortedOverlappingPairCache());
|
||||
// m_broadphase = new btCudaBroadphase(aabbMin, aabbMax, 8, 8, 8, 8192, 8192, 64, 16);
|
||||
// m_broadphase = new btCudaBroadphase(aabbMin, aabbMax, 12, 12, 12, 8192, 8192, 64, 16);
|
||||
// m_broadphase = new btCudaBroadphase(aabbMin, aabbMax, 16, 16, 16, 8192, 8192, 64, 16);
|
||||
m_broadphase = new btCudaBroadphase(aabbMin, aabbMax, 24, 24, 24, 8192, 8192, 64, 16);
|
||||
// m_broadphase = new btCudaBroadphase(aabbMin, aabbMax, 32, 32, 32, 8192, 8192, 64, 16);
|
||||
methodname = "btCudaBroadphase";
|
||||
break;
|
||||
default:
|
||||
{
|
||||
m_broadphase = new btAxisSweep3(aabbMin,aabbMax,numBoxes,new btNullPairCache());
|
||||
@@ -586,8 +600,22 @@ void BulletSAPCompleteBoxPruningTest::PerformTest()
|
||||
m_broadphase->setAabb(m_proxies[i],aabbMin,aabbMax,0);//m_dispatcher);
|
||||
}
|
||||
|
||||
#ifndef BT_NO_PROFILE
|
||||
if(sBulletProfilerToggle)
|
||||
{
|
||||
CProfileManager::Reset();
|
||||
}
|
||||
#endif //BT_NO_PROFILE
|
||||
|
||||
m_broadphase->calculateOverlappingPairs(0);
|
||||
|
||||
#ifndef BT_NO_PROFILE
|
||||
if(sBulletProfilerToggle)
|
||||
{
|
||||
CProfileManager::Increment_Frame_Counter();
|
||||
CProfileManager::dumpAll();
|
||||
}
|
||||
#endif //BT_NO_PROFILE
|
||||
|
||||
|
||||
mProfiler.End();
|
||||
@@ -706,7 +734,7 @@ void BulletSAPCompleteBoxPruningTest::PerformTest()
|
||||
}
|
||||
|
||||
char Buffer[4096];
|
||||
sprintf(Buffer, "Bullet %s: %5.1f us (%d cycles) : %d pairs\n", methodname, mProfiler.mMsTime, mProfiler.mCycles,
|
||||
sprintf_s(Buffer, sizeof(Buffer), "Bullet %s: %5.1f us (%d cycles) : %d pairs\n", methodname, mProfiler.mMsTime, mProfiler.mCycles,
|
||||
m_broadphase->getOverlappingPairCache()->getNumOverlappingPairs());
|
||||
|
||||
// m_broadphase)->printStats();
|
||||
@@ -1004,6 +1032,14 @@ if((!m_isdbvt)||(!enableCulling))
|
||||
|
||||
void BulletSAPCompleteBoxPruningTest::KeyboardCallback(unsigned char key, int x, int y)
|
||||
{
|
||||
switch (key)
|
||||
{
|
||||
case 'p':
|
||||
case 'P':
|
||||
sBulletProfilerToggle = !sBulletProfilerToggle;
|
||||
break;
|
||||
default : break;
|
||||
}
|
||||
}
|
||||
|
||||
void BulletSAPCompleteBoxPruningTest::MouseCallback(int button, int state, int x, int y)
|
||||
|
||||
@@ -29,6 +29,7 @@ subject to the following restrictions:
|
||||
#include "Camera.h"
|
||||
#include "GLFontRenderer.h"
|
||||
#include "BulletCollision/BroadphaseCollision/btDbvtBroadphase.h"
|
||||
#include "LinearMath/btQuickprof.h"
|
||||
|
||||
#define NUM_SAP_BOXES 8192
|
||||
//#define NUM_SAP_BOXES 1024
|
||||
@@ -73,12 +74,15 @@ enum TestIndex
|
||||
TEST_BULLET_MULTISAP_8192,
|
||||
// TEST_BIPARTITE_BOX_PRUNING,
|
||||
TEST_DBVT_8192,
|
||||
TEST_BULLET_CUDA_8192,
|
||||
TEST_OPCODE_ARRAY_SAP,
|
||||
MAX_NB_TESTS
|
||||
};
|
||||
|
||||
static int gTest = TEST_DBVT_8192;//TEST_BULLET_MULTISAP_8192;
|
||||
static int gSelectedTest = TEST_DBVT_8192;//TEST_BULLET_MULTISAP_8192;
|
||||
//static int gTest = TEST_DBVT_8192;//TEST_BULLET_MULTISAP_8192;
|
||||
//static int gSelectedTest = TEST_DBVT_8192;//TEST_BULLET_MULTISAP_8192;
|
||||
static int gTest = TEST_BULLET_CUDA_8192;
|
||||
static int gSelectedTest = TEST_BULLET_CUDA_8192;
|
||||
static CollisionTest* gCollisionTests[MAX_NB_TESTS];
|
||||
|
||||
static GLFontRenderer gFnt;
|
||||
@@ -306,6 +310,7 @@ int main(int argc, char** argv)
|
||||
{TEST_BULLET_MULTISAP_8192, "Bullet MultiSAP 8192"},
|
||||
// {TEST_BIPARTITE_BOX_PRUNING, "Bipartite box pruning"},
|
||||
{TEST_DBVT_8192, "Bullet DBVT 8192"},
|
||||
{TEST_BULLET_CUDA_8192, "Bullet CUDA 8192"},
|
||||
{TEST_OPCODE_ARRAY_SAP, "OPCODE ARRAY SAP"},
|
||||
};
|
||||
TwType testType = TwDefineEnum("CollisionTest", testEV, MAX_NB_TESTS);
|
||||
@@ -328,6 +333,7 @@ int main(int argc, char** argv)
|
||||
gCollisionTests[TEST_BULLET_MULTISAP_8192] = new BulletSAPCompleteBoxPruningTest(NUM_SAP_BOXES,6);
|
||||
// gCollisionTests[TEST_BIPARTITE_BOX_PRUNING] = new BipartiteBoxPruningTest;
|
||||
gCollisionTests[TEST_DBVT_8192] = new BulletSAPCompleteBoxPruningTest(NUM_SAP_BOXES,7);
|
||||
gCollisionTests[TEST_BULLET_CUDA_8192] = new BulletSAPCompleteBoxPruningTest(NUM_SAP_BOXES,8);
|
||||
gCollisionTests[TEST_OPCODE_ARRAY_SAP] = new OpcodeArraySAPTest(NUM_SAP_BOXES);
|
||||
|
||||
for(int i=0;i<MAX_NB_TESTS;i++)
|
||||
|
||||
@@ -2,9 +2,10 @@ Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CDTestFramework", "CDTestFramework.vcproj", "{0565DB39-45CC-416E-B549-BFC24F2666D1}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{F74E8E02-0B47-4816-BD0B-FAEAE3343165} = {F74E8E02-0B47-4816-BD0B-FAEAE3343165}
|
||||
{6ADA430D-009C-2ED4-A787-2AC2D6FEB8CE} = {6ADA430D-009C-2ED4-A787-2AC2D6FEB8CE}
|
||||
{7D6E339F-9C2C-31DA-FDB0-5EE50973CF2A} = {7D6E339F-9C2C-31DA-FDB0-5EE50973CF2A}
|
||||
{DBE44CA3-2912-4441-8D99-AA2242688AD2} = {DBE44CA3-2912-4441-8D99-AA2242688AD2}
|
||||
{7D6E339F-9C2C-31DA-FDB0-5EE50973CF2A} = {7D6E339F-9C2C-31DA-FDB0-5EE50973CF2A}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Opcode", "Opcode\Opcode.vcproj", "{DBE44CA3-2912-4441-8D99-AA2242688AD2}"
|
||||
@@ -13,46 +14,78 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbulletmath", "..\..\msvc
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbulletcollision", "..\..\msvc\8\libbulletcollision.vcproj", "{6ADA430D-009C-2ED4-A787-2AC2D6FEB8CE}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbulletcuda", "..\CUDA\libbulletcuda.vcproj", "{F74E8E02-0B47-4816-BD0B-FAEAE3343165}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
DebugDll|Win32 = DebugDll|Win32
|
||||
DebugDoublePrecision|Win32 = DebugDoublePrecision|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
ReleaseDll|Win32 = ReleaseDll|Win32
|
||||
ReleaseDoublePrecision|Win32 = ReleaseDoublePrecision|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{0565DB39-45CC-416E-B549-BFC24F2666D1}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{0565DB39-45CC-416E-B549-BFC24F2666D1}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{0565DB39-45CC-416E-B549-BFC24F2666D1}.DebugDll|Win32.ActiveCfg = Debug|Win32
|
||||
{0565DB39-45CC-416E-B549-BFC24F2666D1}.DebugDll|Win32.Build.0 = Debug|Win32
|
||||
{0565DB39-45CC-416E-B549-BFC24F2666D1}.DebugDoublePrecision|Win32.ActiveCfg = Debug|Win32
|
||||
{0565DB39-45CC-416E-B549-BFC24F2666D1}.DebugDoublePrecision|Win32.Build.0 = Debug|Win32
|
||||
{0565DB39-45CC-416E-B549-BFC24F2666D1}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{0565DB39-45CC-416E-B549-BFC24F2666D1}.Release|Win32.Build.0 = Release|Win32
|
||||
{0565DB39-45CC-416E-B549-BFC24F2666D1}.ReleaseDll|Win32.ActiveCfg = Release|Win32
|
||||
{0565DB39-45CC-416E-B549-BFC24F2666D1}.ReleaseDll|Win32.Build.0 = Release|Win32
|
||||
{0565DB39-45CC-416E-B549-BFC24F2666D1}.ReleaseDoublePrecision|Win32.ActiveCfg = Release|Win32
|
||||
{0565DB39-45CC-416E-B549-BFC24F2666D1}.ReleaseDoublePrecision|Win32.Build.0 = Release|Win32
|
||||
{DBE44CA3-2912-4441-8D99-AA2242688AD2}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{DBE44CA3-2912-4441-8D99-AA2242688AD2}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{DBE44CA3-2912-4441-8D99-AA2242688AD2}.DebugDll|Win32.ActiveCfg = Debug|Win32
|
||||
{DBE44CA3-2912-4441-8D99-AA2242688AD2}.DebugDll|Win32.Build.0 = Debug|Win32
|
||||
{DBE44CA3-2912-4441-8D99-AA2242688AD2}.DebugDoublePrecision|Win32.ActiveCfg = Debug|Win32
|
||||
{DBE44CA3-2912-4441-8D99-AA2242688AD2}.DebugDoublePrecision|Win32.Build.0 = Debug|Win32
|
||||
{DBE44CA3-2912-4441-8D99-AA2242688AD2}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{DBE44CA3-2912-4441-8D99-AA2242688AD2}.Release|Win32.Build.0 = Release|Win32
|
||||
{DBE44CA3-2912-4441-8D99-AA2242688AD2}.ReleaseDll|Win32.ActiveCfg = Release|Win32
|
||||
{DBE44CA3-2912-4441-8D99-AA2242688AD2}.ReleaseDll|Win32.Build.0 = Release|Win32
|
||||
{DBE44CA3-2912-4441-8D99-AA2242688AD2}.ReleaseDoublePrecision|Win32.ActiveCfg = Release|Win32
|
||||
{DBE44CA3-2912-4441-8D99-AA2242688AD2}.ReleaseDoublePrecision|Win32.Build.0 = Release|Win32
|
||||
{7D6E339F-9C2C-31DA-FDB0-5EE50973CF2A}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{7D6E339F-9C2C-31DA-FDB0-5EE50973CF2A}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{7D6E339F-9C2C-31DA-FDB0-5EE50973CF2A}.DebugDll|Win32.ActiveCfg = DebugDll|Win32
|
||||
{7D6E339F-9C2C-31DA-FDB0-5EE50973CF2A}.DebugDll|Win32.Build.0 = DebugDll|Win32
|
||||
{7D6E339F-9C2C-31DA-FDB0-5EE50973CF2A}.DebugDoublePrecision|Win32.ActiveCfg = DebugDoublePrecision|Win32
|
||||
{7D6E339F-9C2C-31DA-FDB0-5EE50973CF2A}.DebugDoublePrecision|Win32.Build.0 = DebugDoublePrecision|Win32
|
||||
{7D6E339F-9C2C-31DA-FDB0-5EE50973CF2A}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{7D6E339F-9C2C-31DA-FDB0-5EE50973CF2A}.Release|Win32.Build.0 = Release|Win32
|
||||
{7D6E339F-9C2C-31DA-FDB0-5EE50973CF2A}.ReleaseDll|Win32.ActiveCfg = ReleaseDll|Win32
|
||||
{7D6E339F-9C2C-31DA-FDB0-5EE50973CF2A}.ReleaseDll|Win32.Build.0 = ReleaseDll|Win32
|
||||
{7D6E339F-9C2C-31DA-FDB0-5EE50973CF2A}.ReleaseDoublePrecision|Win32.ActiveCfg = ReleaseDoublePrecision|Win32
|
||||
{7D6E339F-9C2C-31DA-FDB0-5EE50973CF2A}.ReleaseDoublePrecision|Win32.Build.0 = ReleaseDoublePrecision|Win32
|
||||
{6ADA430D-009C-2ED4-A787-2AC2D6FEB8CE}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{6ADA430D-009C-2ED4-A787-2AC2D6FEB8CE}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{6ADA430D-009C-2ED4-A787-2AC2D6FEB8CE}.DebugDll|Win32.ActiveCfg = DebugDll|Win32
|
||||
{6ADA430D-009C-2ED4-A787-2AC2D6FEB8CE}.DebugDll|Win32.Build.0 = DebugDll|Win32
|
||||
{6ADA430D-009C-2ED4-A787-2AC2D6FEB8CE}.DebugDoublePrecision|Win32.ActiveCfg = DebugDoublePrecision|Win32
|
||||
{6ADA430D-009C-2ED4-A787-2AC2D6FEB8CE}.DebugDoublePrecision|Win32.Build.0 = DebugDoublePrecision|Win32
|
||||
{6ADA430D-009C-2ED4-A787-2AC2D6FEB8CE}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{6ADA430D-009C-2ED4-A787-2AC2D6FEB8CE}.Release|Win32.Build.0 = Release|Win32
|
||||
{6ADA430D-009C-2ED4-A787-2AC2D6FEB8CE}.ReleaseDll|Win32.ActiveCfg = ReleaseDll|Win32
|
||||
{6ADA430D-009C-2ED4-A787-2AC2D6FEB8CE}.ReleaseDll|Win32.Build.0 = ReleaseDll|Win32
|
||||
{6ADA430D-009C-2ED4-A787-2AC2D6FEB8CE}.ReleaseDoublePrecision|Win32.ActiveCfg = ReleaseDoublePrecision|Win32
|
||||
{6ADA430D-009C-2ED4-A787-2AC2D6FEB8CE}.ReleaseDoublePrecision|Win32.Build.0 = ReleaseDoublePrecision|Win32
|
||||
{F74E8E02-0B47-4816-BD0B-FAEAE3343165}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{F74E8E02-0B47-4816-BD0B-FAEAE3343165}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{F74E8E02-0B47-4816-BD0B-FAEAE3343165}.DebugDll|Win32.ActiveCfg = DebugDll|Win32
|
||||
{F74E8E02-0B47-4816-BD0B-FAEAE3343165}.DebugDll|Win32.Build.0 = DebugDll|Win32
|
||||
{F74E8E02-0B47-4816-BD0B-FAEAE3343165}.DebugDoublePrecision|Win32.ActiveCfg = DebugDoublePrecision|Win32
|
||||
{F74E8E02-0B47-4816-BD0B-FAEAE3343165}.DebugDoublePrecision|Win32.Build.0 = DebugDoublePrecision|Win32
|
||||
{F74E8E02-0B47-4816-BD0B-FAEAE3343165}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{F74E8E02-0B47-4816-BD0B-FAEAE3343165}.Release|Win32.Build.0 = Release|Win32
|
||||
{F74E8E02-0B47-4816-BD0B-FAEAE3343165}.ReleaseDll|Win32.ActiveCfg = ReleaseDll|Win32
|
||||
{F74E8E02-0B47-4816-BD0B-FAEAE3343165}.ReleaseDll|Win32.Build.0 = ReleaseDll|Win32
|
||||
{F74E8E02-0B47-4816-BD0B-FAEAE3343165}.ReleaseDoublePrecision|Win32.ActiveCfg = ReleaseDoublePrecision|Win32
|
||||
{F74E8E02-0B47-4816-BD0B-FAEAE3343165}.ReleaseDoublePrecision|Win32.Build.0 = ReleaseDoublePrecision|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Version="8.00"
|
||||
Name="CDTestFramework"
|
||||
ProjectGUID="{0565DB39-45CC-416E-B549-BFC24F2666D1}"
|
||||
Keyword="Win32Proj"
|
||||
@@ -62,9 +62,10 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="cudart.lib"
|
||||
OutputFile="./Bin/CDTestFrameworkDEBUG.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=".\AntTweakBar\lib,../../Glut"
|
||||
AdditionalLibraryDirectories=".\AntTweakBar\lib;../../Glut;"$(CUDA_LIB_PATH)""
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)/CDTestFramework.pdb"
|
||||
SubSystem="1"
|
||||
@@ -145,9 +146,10 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="cudart.lib"
|
||||
OutputFile="./Bin/CDTestFramework.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=".\AntTweakBar\lib,../../Glut"
|
||||
AdditionalLibraryDirectories=".\AntTweakBar\lib,../../Glut;"$(CUDA_LIB_PATH)""
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
|
||||
Reference in New Issue
Block a user