9 #define MSTRINGIFY(A) #A
11 #include "OpenCLC10/OutputToVertexArray.cl"
14 #define RELEASE_CL_KERNEL(kernelName) {if( kernelName ){ clReleaseKernel( kernelName ); kernelName = 0; }}
29 const int lastVertex = firstVertex + currentCloth->
getNumVertices();
44 btAssert( 0 &&
"clEnqueueAcquireGLObjects(copySoftBodyToVertexBuffer)");
49 ciErrNum =
clSetKernelArg(outputKernel, 0,
sizeof(
int), &firstVertex );
50 ciErrNum =
clSetKernelArg(outputKernel, 1,
sizeof(
int), &numVertices );
56 ciErrNum =
clSetKernelArg(outputKernel, 3,
sizeof(
int), &vertexOffset );
57 ciErrNum =
clSetKernelArg(outputKernel, 4,
sizeof(
int), &vertexStride );
65 ciErrNum =
clSetKernelArg(outputKernel, 6,
sizeof(
int), &normalOffset );
66 ciErrNum =
clSetKernelArg(outputKernel, 7,
sizeof(
int), &normalStride );
74 btAssert( 0 &&
"enqueueNDRangeKernel(copySoftBodyToVertexBuffer)");
80 btAssert( 0 &&
"clEnqueueReleaseGLObjects(copySoftBodyToVertexBuffer)");
83 btAssert(
"Undefined output for this solver output" ==
false );
96 bool returnVal =
true;
bool m_shadersInitialized
btOpenCLBuffer< Vectormath::Aos::Point3 > m_clVertexPosition
virtual bool buildShaders()
virtual bool hasVertexPositions() const
virtual BufferTypes getBufferType() const =0
Return the type of the vertex buffer descriptor.
virtual cl_kernel compileCLKernelFromString(const char *kernelSource, const char *kernelName, const char *additionalMacros, const char *srcFileNameForCaching)
Compile a compute shader kernel from a string and return the appropriate cl_kernel object...
SoftBody class to maintain information about a soft body instance within a solver.
CL_API_ENTRY cl_int CL_API_CALL clEnqueueNDRangeKernel(cl_command_queue, cl_kernel, cl_uint, const size_t *, const size_t *, const size_t *, cl_uint, const cl_event *, cl_event *) CL_API_SUFFIX__VERSION_1_0
virtual bool checkInitialized()
static const size_t workGroupSize
cl_kernel outputToVertexArrayWithoutNormalsKernel
cl_kernel outputToVertexArrayWithNormalsKernel
cl_command_queue m_cqCommandQue
#define RELEASE_CL_KERNEL(kernelName)
CL_API_ENTRY cl_int CL_API_CALL clFinish(cl_command_queue) CL_API_SUFFIX__VERSION_1_0
virtual SolverTypes getSolverType() const =0
Return the type of the solver.
static char * OutputToVertexArrayCLString
struct _cl_kernel * cl_kernel
btSoftBodySolver * getSoftBodySolver()
CL_API_ENTRY cl_int CL_API_CALL clEnqueueReleaseGLObjects(cl_command_queue, cl_uint, const cl_mem *, cl_uint, const cl_event *, cl_event *) CL_API_SUFFIX__VERSION_1_0
CL_API_ENTRY cl_int CL_API_CALL clSetKernelArg(cl_kernel, cl_uint, size_t, const void *) CL_API_SUFFIX__VERSION_1_0
virtual int getVertexStride() const
Return the vertex stride in number of floats between vertices.
virtual cl_mem getBuffer() const
virtual int getVertexOffset() const
Return the vertex offset in floats from the base pointer.
virtual int getNormalOffset() const
Return the vertex offset in floats from the base pointer.
btOpenCLBuffer< Vectormath::Aos::Vector3 > m_clVertexNormal
CL_API_ENTRY cl_int CL_API_CALL clEnqueueAcquireGLObjects(cl_command_queue, cl_uint, const cl_mem *, cl_uint, const cl_event *, cl_event *) CL_API_SUFFIX__VERSION_1_0
virtual void copySoftBodyToVertexBuffer(const btSoftBody *const softBody, btVertexBufferDescriptor *vertexBuffer)
Output current computed vertex data to the vertex buffers for all cloths in the solver.
The btSoftBody is an class to simulate cloth and volumetric soft bodies.
virtual bool hasNormals() const
virtual int getNormalStride() const
Return the vertex stride in number of floats between vertices.