improve Mac OSX/Unix benchmark

This commit is contained in:
Erwin Coumans 2013-05-23 20:38:27 -07:00
parent c8b979e7ef
commit a92223890f
5 changed files with 34 additions and 18 deletions

View File

@ -3,6 +3,8 @@
#ifdef _WIN32
#include <Windows.h> //for GetLocalTime/GetSystemTime
#else
#include <sys/time.h>//gettimeofday
#endif
#ifdef __APPLE__
@ -592,7 +594,7 @@ int main(int argc, char* argv[])
bool useGpu = false;
int maxObjectCapacity=256*1024;
int maxObjectCapacity=128*1024;
ci.m_instancingRenderer = new GLInstancingRenderer(maxObjectCapacity);//render.getInstancingRenderer();
ci.m_window = window;
@ -622,7 +624,8 @@ int main(int argc, char* argv[])
b3OpenCLDeviceInfo info;
b3OpenCLUtils::getDeviceInfo(demo->getInternalData()->m_clDevice,&info);
//todo: move this time stuff into the Platform/Window class
#ifdef _WIN32
SYSTEMTIME time;
GetLocalTime(&time);
@ -639,7 +642,24 @@ int main(int argc, char* argv[])
sprintf(prefixFileName,"%s_%s_%s_%d_%d_%d_date_%d-%d-%d_time_%d-%d-%d",info.m_deviceName,buf,demoNames[selectedDemo],ci.arraySizeX,ci.arraySizeY,ci.arraySizeZ,time.wDay,time.wMonth,time.wYear,time.wHour,time.wMinute,time.wSecond);
#else
sprintf(prefixFileName,"%s_%d_%d_%d",info.m_deviceName,ci.arraySizeX,ci.arraySizeY,ci.arraySizeZ);
timeval now;
gettimeofday(&now,0);
struct tm* ptm;
ptm = localtime (&now.tv_sec);
char buf[1024];
#ifdef __APPLE__
sprintf(buf,"MacOSX");
#else
sprintf(buf,"Unix");
#endif
sprintf(prefixFileName,"%s_%s_%s_%d_%d_%d_date_%d-%d-%d_time_%d-%d-%d",info.m_deviceName,buf,demoNames[selectedDemo],ci.arraySizeX,ci.arraySizeY,ci.arraySizeZ,
ptm->tm_mday,
ptm->tm_mon+1,
ptm->tm_year+1900,
ptm->tm_hour,
ptm->tm_min,
ptm->tm_sec);
#endif

View File

@ -256,19 +256,19 @@ void ConcaveScene::setupScene(const ConstructionInfo& ci)
char* fileName = "data/samurai_monastry.obj";
// char* fileName = "data/teddy2_VHACD_CHs.obj";
b3Vector3 shift1(0,-50,0);//0,230,80);//150,-100,-120);
b3Vector3 shift1(0,0,0);//0,230,80);//150,-100,-120);
b3Vector4 scaling(4,4,4,1);
// createConcaveMesh(ci,"data/plane100.obj",shift1,scaling);
//createConcaveMesh(ci,"data/plane100.obj",shift,scaling);
b3Vector3 shift2(0,0,0);//0,230,80);//150,-100,-120);
createConcaveMesh(ci,"data/teddy.obj",shift2,scaling);
// b3Vector3 shift2(0,0,0);//0,230,80);//150,-100,-120);
// createConcaveMesh(ci,"data/teddy.obj",shift2,scaling);
b3Vector3 shift3(130,-150,-75);//0,230,80);//150,-100,-120);
// b3Vector3 shift3(130,-150,-75);//0,230,80);//150,-100,-120);
// createConcaveMesh(ci,"data/leoTest1.obj",shift3,scaling);
createConcaveMesh(ci,"data/samurai_monastry.obj",shift3,scaling);
createConcaveMesh(ci,"data/samurai_monastry.obj",shift1,scaling);
} else
{
@ -341,7 +341,7 @@ void ConcaveScene::createDynamicObjects(const ConstructionInfo& ci)
float mass = 1;
//b3Vector3 position(-2*ci.gapX+i*ci.gapX,25+j*ci.gapY,-2*ci.gapZ+k*ci.gapZ);
b3Vector3 position(-(ci.arraySizeX/2)*CONCAVE_GAPX+i*CONCAVE_GAPX,150+j*CONCAVE_GAPY,-(ci.arraySizeZ/2)*CONCAVE_GAPZ+k*CONCAVE_GAPZ);
b3Vector3 position(-(ci.arraySizeX/2)*CONCAVE_GAPX+i*CONCAVE_GAPX,3+j*CONCAVE_GAPY,-(ci.arraySizeZ/2)*CONCAVE_GAPZ+k*CONCAVE_GAPZ);
b3Quaternion orn(0,0,0,1);
b3Vector4 color = colors[curColor];

View File

@ -44,15 +44,10 @@ void GpuConvexScene::setupScene(const ConstructionInfo& ci)
int GpuConvexScene::createDynamicsObjects(const ConstructionInfo& ci)
{
/* int strideInBytes = 9*sizeof(float);
int strideInBytes = 9*sizeof(float);
int numVertices = sizeof(barrel_vertices)/strideInBytes;
int numIndices = sizeof(barrel_indices)/sizeof(int);
return createDynamicsObjects2(ci,barrel_vertices,numVertices,barrel_indices,numIndices);
*/
int strideInBytes = 9*sizeof(float);
int numVertices = sizeof(cube_vertices)/strideInBytes;
int numIndices = sizeof(cube_indices)/sizeof(int);
return createDynamicsObjects2(ci,cube_vertices,numVertices,cube_indices,numIndices);
}
int GpuBoxPlaneScene::createDynamicsObjects(const ConstructionInfo& ci)

View File

@ -11,11 +11,12 @@
#pragma warning(disable :4996)
#endif
#define B3_CL_MAX_ARG_SIZE 16
struct b3KernelArgData
B3_ATTRIBUTE_ALIGNED16(struct) b3KernelArgData
{
int m_isBuffer;
int m_argIndex;
int m_argSizeInBytes;
int m_unusedPadding;
union
{
cl_mem m_clBuffer;

View File

@ -27,8 +27,8 @@ struct b3Config
m_maxConvexIndices(8192),
m_maxConvexUniqueEdges(8192),
m_maxCompoundChildShapes(8192),
//m_maxTriConvexPairCapacity(512*1024)
m_maxTriConvexPairCapacity(256*1024)
m_maxTriConvexPairCapacity(512*1024)
//m_maxTriConvexPairCapacity(256*1024)
{
m_maxBroadphasePairs = 16*m_maxConvexBodies;
m_maxContactCapacity = m_maxBroadphasePairs;