btSoftBodySolver_OpenCL::setDefaultWorkgroupSize to customize the work group size.

Thanks to Simon Green for the feedback, see also Issue 419

Added BT_PROFILE for "predictUnconstraintMotionSoftBody"

Added a few missing destructors.
Added AllMemoryBarrier
Thanks to Lee Howes for the commit in the branch.
This commit is contained in:
erwin.coumans
2010-09-08 22:21:59 +00:00
parent c296122e4e
commit cb2de12243
6 changed files with 65 additions and 27 deletions

View File

@@ -185,6 +185,7 @@ private:
bool m_shadersInitialized;
/**
* Cloths owned by this solver.
* Only our cloths are in this array.
@@ -246,6 +247,8 @@ private:
cl_command_queue m_cqCommandQue;
cl_context m_cxMainContext;
size_t m_defaultWorkGroupSize;
/**
* Compile a compute shader kernel from a string and return the appropriate cl_kernel object.
@@ -327,6 +330,15 @@ public:
virtual void predictMotion( float solverdt );
virtual void copySoftBodyToVertexBuffer( const btSoftBody *const softBody, btVertexBufferDescriptor *vertexBuffer );
virtual void setDefaultWorkgroupSize(size_t workGroupSize)
{
m_defaultWorkGroupSize = workGroupSize;
}
virtual size_t getDefaultWorkGroupSize() const
{
return m_defaultWorkGroupSize;
}
}; // btOpenCLSoftBodySolver
#endif // #ifndef BT_SOFT_BODY_SOLVER_OPENCL_H