fix issue with btDbvt::collideOCL, related to memmove (needs further testing)
only enable OpenCL demo if flag --enable_experimental_opencl is passed to ExampleBrowser
This commit is contained in:
@@ -1193,17 +1193,23 @@ inline void btDbvt::collideOCL( const btDbvtNode* root,
|
||||
/* Insert 0 */
|
||||
j=nearest(&stack[0],&stock[0],nes[q].value,0,stack.size());
|
||||
stack.push_back(0);
|
||||
|
||||
//void * memmove ( void * destination, const void * source, size_t num );
|
||||
|
||||
#if DBVT_USE_MEMMOVE
|
||||
memmove(&stack[j+1],&stack[j],sizeof(int)*(stack.size()-j-1));
|
||||
memmove(&stack[j],&stack[j-1],sizeof(int)*(stack.size()-j-1));
|
||||
#else
|
||||
for(int k=stack.size()-1;k>j;--k) stack[k]=stack[k-1];
|
||||
for(int k=stack.size()-1;k>j;--k)
|
||||
{
|
||||
stack[k]=stack[k-1];
|
||||
}
|
||||
#endif
|
||||
stack[j]=allocate(ifree,stock,nes[q]);
|
||||
/* Insert 1 */
|
||||
j=nearest(&stack[0],&stock[0],nes[1-q].value,j,stack.size());
|
||||
stack.push_back(0);
|
||||
#if DBVT_USE_MEMMOVE
|
||||
memmove(&stack[j+1],&stack[j],sizeof(int)*(stack.size()-j-1));
|
||||
memmove(&stack[j],&stack[j-1],sizeof(int)*(stack.size()-j-1));
|
||||
#else
|
||||
for(int k=stack.size()-1;k>j;--k) stack[k]=stack[k-1];
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user