diff --git a/Demos3/GpuDemos/main_opengl3core.cpp b/Demos3/GpuDemos/main_opengl3core.cpp index 3dbbc37a6..5b4c3b2a7 100644 --- a/Demos3/GpuDemos/main_opengl3core.cpp +++ b/Demos3/GpuDemos/main_opengl3core.cpp @@ -59,6 +59,7 @@ extern float shadowMapWidth; extern float shadowMapHeight; extern bool gDebugLauncherCL; extern bool gAllowCpuOpenCL; +extern bool gUseLargeBatches; extern bool gDebugForceLoadingFromSource; extern bool gDebugSkipLoadingBinary; @@ -633,7 +634,7 @@ int main(int argc, char* argv[]) args.GetCmdLineArgument("cl_device", ci.preferredOpenCLDeviceIndex); args.GetCmdLineArgument("cl_platform", ci.preferredOpenCLPlatformIndex); gAllowCpuOpenCL = args.CheckCmdLineFlag("allow_opencl_cpu"); - + gUseLargeBatches = args.CheckCmdLineFlag("use_large_batches"); gUseJacobi = args.CheckCmdLineFlag("use_jacobi"); gUseDbvt = args.CheckCmdLineFlag("use_dbvt"); diff --git a/src/Bullet3OpenCL/RigidBody/b3GpuPgsContactSolver.cpp b/src/Bullet3OpenCL/RigidBody/b3GpuPgsContactSolver.cpp index 19c4bad82..5c5acb1fe 100644 --- a/src/Bullet3OpenCL/RigidBody/b3GpuPgsContactSolver.cpp +++ b/src/Bullet3OpenCL/RigidBody/b3GpuPgsContactSolver.cpp @@ -1,5 +1,5 @@ -bool oneBigBatch = true; +bool gUseLargeBatches = false; bool gCpuBatchContacts = false; bool gCpuSolveConstraint = false; bool gCpuRadixSort=false; @@ -771,7 +771,7 @@ void b3GpuPgsContactSolver::solveContacts(int numBodies, cl_mem bodyBuf, cl_mem int maxNumBatches = 0; - if (!oneBigBatch) + if (!gUseLargeBatches) { if( m_data->m_solverGPU->m_contactBuffer2) @@ -1064,7 +1064,7 @@ void b3GpuPgsContactSolver::solveContacts(int numBodies, cl_mem bodyBuf, cl_mem int numNonzeroGrid=0; - if (oneBigBatch) + if (gUseLargeBatches) { m_data->m_batchSizes.resize(B3_MAX_NUM_BATCHES); int totalNumConstraints = cpuContacts.size(); @@ -1125,7 +1125,7 @@ void b3GpuPgsContactSolver::solveContacts(int numBodies, cl_mem bodyBuf, cl_mem //printf("maxNumBatches = %d\n", maxNumBatches); - if (oneBigBatch) + if (gUseLargeBatches) { if (nContacts) { @@ -1197,7 +1197,7 @@ void b3GpuPgsContactSolver::solveContacts(int numBodies, cl_mem bodyBuf, cl_mem //m_data->m_batchSizesGpu->copyFromHost(m_data->m_batchSizes); - if (oneBigBatch) + if (gUseLargeBatches) { solveContactConstraintBatchSizes(m_data->m_bodyBufferGPU, m_data->m_inertiaBufferGPU,