add some clFinish for better profile timings

improved parallel batching, don't try to write for static objects,
this fixed a bug, when the hash of a static object was identical with hash of dynamic objects, causing it to be assigned a bogus 100+i batching number
The parallel batching is still not enabled, because we need to measure the batching size (todo)
This commit is contained in:
erwincoumans
2013-07-15 10:22:40 -07:00
parent 05ed1fdbcf
commit a5d00c8219
4 changed files with 28 additions and 20 deletions

View File

@@ -216,19 +216,21 @@ __kernel void CreateBatches( __global const Contact4* gConstraints, __global Con
if( aUsed==0 && bUsed==0 )
{
int aAvailable;
int bAvailable;
int aAvailable=1;
int bAvailable=1;
int ea = abs(e.m_a);
int eb = abs(e.m_b);
aAvailable = tryWrite( ldsCheckBuffer, ea );
bAvailable = tryWrite( ldsCheckBuffer, eb );
bool aStatic = (e.m_a<0) ||(ea==m_staticIdx);
bool bStatic = (e.m_b<0) ||(eb==m_staticIdx);
aAvailable = aStatic? 1: aAvailable;
bAvailable = bStatic? 1: bAvailable;
if (!aStatic)
aAvailable = tryWrite( ldsCheckBuffer, ea );
if (!bStatic)
bAvailable = tryWrite( ldsCheckBuffer, eb );
//aAvailable = aStatic? 1: aAvailable;
//bAvailable = bStatic? 1: bAvailable;
bool success = (aAvailable && bAvailable);
if(success)