RavEngine
Loading...
Searching...
No Matches
physx::Ext::DefaultCpuDispatcher Class Reference
Inheritance diagram for physx::Ext::DefaultCpuDispatcher:
[legend]
Collaboration diagram for physx::Ext::DefaultCpuDispatcher:
[legend]

Public Member Functions

 DefaultCpuDispatcher (PxU32 numThreads, PxU32 *affinityMasks, PxDefaultCpuDispatcherWaitForWorkMode::Enum mode=PxDefaultCpuDispatcherWaitForWorkMode::eWAIT_FOR_WORK, PxU32 yieldProcessorCount=0)
 
virtual void submitTask (PxBaseTask &task) PX_OVERRIDE
 Called by the TaskManager when a task is to be queued for execution.
 
virtual PxU32 getWorkerCount () const PX_OVERRIDE
 Returns the number of available worker threads for this dispatcher.
 
virtual void release () PX_OVERRIDE
 Deletes the dispatcher.
 
virtual void setRunProfiled (bool runProfiled) PX_OVERRIDE
 Enables profiling at task level.
 
virtual bool getRunProfiled () const PX_OVERRIDE
 Checks if profiling is enabled at task level.
 
PxBaseTask * getJob ()
 
PxBaseTask * stealJob ()
 
PxBaseTask * fetchNextTask ()
 
PX_FORCE_INLINE void runTask (PxBaseTask &task)
 
void waitForWork ()
 
void resetWakeSignal ()
 
PX_FORCE_INLINE PxDefaultCpuDispatcherWaitForWorkMode::Enum getWaitForWorkMode () const
 
PX_FORCE_INLINE PxU32 getYieldProcessorCount () const
 
- Public Member Functions inherited from physx::PxUserAllocated
PX_INLINE void * operator new (size_t, void *address)
 
PX_INLINE void operator delete (void *, void *)
 
template<typename Alloc >
PX_INLINE void * operator new (size_t size, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void * operator new (size_t size, size_t, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void * operator new[] (size_t size, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void * operator new[] (size_t size, size_t, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void operator delete (void *ptr, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void operator delete[] (void *ptr, Alloc alloc, const char *fileName, int line)
 
PX_INLINE void operator delete (void *ptr)
 
PX_INLINE void operator delete[] (void *ptr)
 

Static Public Member Functions

static void getAffinityMasks (PxU32 *affinityMasks, PxU32 threadCount)
 

Protected Attributes

CpuWorkerThread * mWorkerThreads
 
SharedQueueEntryPool mQueueEntryPool
 
PxSList mJobList
 
PxSync mWorkReady
 
PxU8 * mThreadNames
 
PxU32 mNumThreads
 
bool mShuttingDown
 
bool mRunProfiled
 
const PxDefaultCpuDispatcherWaitForWorkMode::Enum mWaitForWorkMode
 
const PxU32 mYieldProcessorCount
 

Friends

class TaskQueueHelper
 

Member Function Documentation

◆ getRunProfiled()

virtual bool physx::Ext::DefaultCpuDispatcher::getRunProfiled ( ) const
inlinevirtual

Checks if profiling is enabled at task level.

Returns
True if tasks should be profiled.

Implements physx::PxDefaultCpuDispatcher.

◆ getWorkerCount()

virtual PxU32 physx::Ext::DefaultCpuDispatcher::getWorkerCount ( ) const
inlinevirtual

Returns the number of available worker threads for this dispatcher.

The SDK will use this count to control how many tasks are submitted. By matching the number of tasks with the number of execution units task overhead can be reduced.

Implements physx::PxCpuDispatcher.

◆ release()

void Ext::DefaultCpuDispatcher::release ( )
virtual

Deletes the dispatcher.

Do not keep a reference to the deleted instance.

See also
PxDefaultCpuDispatcherCreate()

Implements physx::PxDefaultCpuDispatcher.

◆ setRunProfiled()

virtual void physx::Ext::DefaultCpuDispatcher::setRunProfiled ( bool  runProfiled)
inlinevirtual

Enables profiling at task level.

Note
By default enabled only in profiling builds.
Parameters
[in]runProfiledTrue if tasks should be profiled.

Implements physx::PxDefaultCpuDispatcher.

◆ submitTask()

void Ext::DefaultCpuDispatcher::submitTask ( PxBaseTask &  task)
virtual

Called by the TaskManager when a task is to be queued for execution.

Upon receiving a task, the dispatcher should schedule the task to run. After the task has been run, it should call the release() method and discard its pointer.

Parameters
[in]taskThe task to be run.
See also
PxBaseTask

Implements physx::PxCpuDispatcher.


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