16 #ifndef BT_SPU_COLLISION_TASK_PROCESS_H
17 #define BT_SPU_COLLISION_TASK_PROCESS_H
43 #define DEBUG_SpuCollisionTaskProcess 1
46 #define CMD_GATHER_AND_PROCESS_PAIRLIST 1
116 #ifdef DEBUG_SpuCollisionTaskProcess
131 void addWorkToTask(
void* pairArrayPtr,
int startIndex,
int endIndex);
147 #define MIDPHASE_TASK_PTR(task) (&m_workUnitTaskBuffers[0] + MIDPHASE_WORKUNIT_TASK_SIZE*task)
148 #define MIDPHASE_ENTRY_PTR(task,page,entry) (MIDPHASE_TASK_PTR(task) + MIDPHASE_WORKUNIT_PAGE_SIZE*page + sizeof(SpuGatherAndProcessWorkUnitInput)*entry)
149 #define MIDPHASE_OUTPUT_PTR(task) (&m_contactOutputBuffers[0] + MIDPHASE_MAX_CONTACT_BUFFER_SIZE*task)
150 #define MIDPHASE_TREENODES_PTR(task) (&m_complexShapeBuffers[0] + MIDPHASE_COMPLEX_SHAPE_BUFFER_SIZE*task)
153 #define MIDPHASE_WORKUNIT_PAGE_SIZE (16)
156 #define MIDPHASE_NUM_WORKUNIT_PAGES 1
157 #define MIDPHASE_WORKUNIT_TASK_SIZE (MIDPHASE_WORKUNIT_PAGE_SIZE*MIDPHASE_NUM_WORKUNIT_PAGES)
158 #define MIDPHASE_NUM_WORKUNITS_PER_PAGE (MIDPHASE_WORKUNIT_PAGE_SIZE / sizeof(SpuGatherAndProcessWorkUnitInput))
159 #define MIDPHASE_NUM_WORKUNITS_PER_TASK (MIDPHASE_NUM_WORKUNITS_PER_PAGE*MIDPHASE_NUM_WORKUNIT_PAGES)
162 #endif // BT_SPU_COLLISION_TASK_PROCESS_H
~SpuCollisionTaskProcess()
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping...
void setNumTasks(int maxNumTasks)
set the maximum number of SPU tasks allocated
SpuCollisionTaskProcess handles SPU processing of collision pairs.
void initialize2(bool useEpa=false)
call initialize in the beginning of the frame, before addCollisionPairToTask
void flush2()
call flush to submit potential outstanding work to SPUs and wait for all involved SPUs to be finished...
btAlignedObjectArray< bool > m_taskBusy
SpuCollisionTaskProcess(btThreadSupportInterface *threadInterface, unsigned int maxNumOutstandingTasks)
unsigned int m_currentPage
unsigned char * m_workUnitTaskBuffers
unsigned int m_currentTask
class btThreadSupportInterface * m_threadInterface
void addWorkToTask(void *pairArrayPtr, int startIndex, int endIndex)
batch up additional work to a current task for SPU processing. When batch is full, it issues the task.
unsigned int m_currentPageEntry
btCollisionObject can be used to manage collision detection objects.
#define ATTRIBUTE_ALIGNED16(a)
btAlignedObjectArray< SpuGatherAndProcessPairsTaskDesc > m_spuGatherTaskDesc
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
unsigned int m_maxNumOutstandingTasks
unsigned int m_numBusyTasks