Bullet Collision Detection & Physics Library
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SpuCollisionTaskProcess Class Reference

SpuCollisionTaskProcess handles SPU processing of collision pairs. More...

#include <SpuCollisionTaskProcess.h>

Collaboration diagram for SpuCollisionTaskProcess:
Collaboration graph
[legend]

Public Member Functions

 SpuCollisionTaskProcess (btThreadSupportInterface *threadInterface, unsigned int maxNumOutstandingTasks)
 
 ~SpuCollisionTaskProcess ()
 
void initialize2 (bool useEpa=false)
 call initialize in the beginning of the frame, before addCollisionPairToTask More...
 
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. More...
 
void flush2 ()
 call flush to submit potential outstanding work to SPUs and wait for all involved SPUs to be finished More...
 
void setNumTasks (int maxNumTasks)
 set the maximum number of SPU tasks allocated More...
 
int getNumTasks () const
 

Private Member Functions

void issueTask2 ()
 

Private Attributes

unsigned char * m_workUnitTaskBuffers
 
btAlignedObjectArray< bool > m_taskBusy
 
btAlignedObjectArray
< SpuGatherAndProcessPairsTaskDesc
m_spuGatherTaskDesc
 
class btThreadSupportInterfacem_threadInterface
 
unsigned int m_maxNumOutstandingTasks
 
unsigned int m_numBusyTasks
 
unsigned int m_currentTask
 
unsigned int m_currentPage
 
unsigned int m_currentPageEntry
 
bool m_useEpa
 
bool m_initialized
 

Detailed Description

SpuCollisionTaskProcess handles SPU processing of collision pairs.

Maintains a set of task buffers. When the task is full, the task is issued for SPUs to process. Contact output goes into btPersistentManifold associated with each task. When PPU issues a task, it will look for completed task buffers PPU will do postprocessing, dependent on workunit output (not likely)

Definition at line 93 of file SpuCollisionTaskProcess.h.

Constructor & Destructor Documentation

SpuCollisionTaskProcess::SpuCollisionTaskProcess ( btThreadSupportInterface threadInterface,
unsigned int  maxNumOutstandingTasks 
)

Definition at line 53 of file SpuCollisionTaskProcess.cpp.

SpuCollisionTaskProcess::~SpuCollisionTaskProcess ( )

Definition at line 75 of file SpuCollisionTaskProcess.cpp.

Member Function Documentation

void SpuCollisionTaskProcess::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.

Definition at line 182 of file SpuCollisionTaskProcess.cpp.

void SpuCollisionTaskProcess::flush2 ( )

call flush to submit potential outstanding work to SPUs and wait for all involved SPUs to be finished

Definition at line 269 of file SpuCollisionTaskProcess.cpp.

int SpuCollisionTaskProcess::getNumTasks ( ) const
inline

Definition at line 139 of file SpuCollisionTaskProcess.h.

void SpuCollisionTaskProcess::initialize2 ( bool  useEpa = false)

call initialize in the beginning of the frame, before addCollisionPairToTask

Definition at line 92 of file SpuCollisionTaskProcess.cpp.

void SpuCollisionTaskProcess::issueTask2 ( )
private

Definition at line 116 of file SpuCollisionTaskProcess.cpp.

void SpuCollisionTaskProcess::setNumTasks ( int  maxNumTasks)

set the maximum number of SPU tasks allocated

re-allocate task memory buffers

Definition at line 27 of file SpuCollisionTaskProcess.cpp.

Member Data Documentation

unsigned int SpuCollisionTaskProcess::m_currentPage
private

Definition at line 111 of file SpuCollisionTaskProcess.h.

unsigned int SpuCollisionTaskProcess::m_currentPageEntry
private

Definition at line 112 of file SpuCollisionTaskProcess.h.

unsigned int SpuCollisionTaskProcess::m_currentTask
private

Definition at line 110 of file SpuCollisionTaskProcess.h.

bool SpuCollisionTaskProcess::m_initialized
private

Definition at line 117 of file SpuCollisionTaskProcess.h.

unsigned int SpuCollisionTaskProcess::m_maxNumOutstandingTasks
private

Definition at line 105 of file SpuCollisionTaskProcess.h.

unsigned int SpuCollisionTaskProcess::m_numBusyTasks
private

Definition at line 107 of file SpuCollisionTaskProcess.h.

btAlignedObjectArray<SpuGatherAndProcessPairsTaskDesc> SpuCollisionTaskProcess::m_spuGatherTaskDesc
private

Definition at line 101 of file SpuCollisionTaskProcess.h.

btAlignedObjectArray<bool> SpuCollisionTaskProcess::m_taskBusy
private

Definition at line 100 of file SpuCollisionTaskProcess.h.

class btThreadSupportInterface* SpuCollisionTaskProcess::m_threadInterface
private

Definition at line 103 of file SpuCollisionTaskProcess.h.

bool SpuCollisionTaskProcess::m_useEpa
private

Definition at line 114 of file SpuCollisionTaskProcess.h.

unsigned char* SpuCollisionTaskProcess::m_workUnitTaskBuffers
private

Definition at line 96 of file SpuCollisionTaskProcess.h.


The documentation for this class was generated from the following files: