RavEngine
Loading...
Searching...
No Matches
physx::PxLightCpuTask Class Reference

A PxBaseTask implementation with immediate execution and simple dependencies. More...

#include <PxTask.h>

Inheritance diagram for physx::PxLightCpuTask:
[legend]
Collaboration diagram for physx::PxLightCpuTask:
[legend]

Public Member Functions

PX_INLINE void setContinuation (PxTaskManager &tm, PxBaseTask *c)
 Initialize this task and specify the task that will have its ref count decremented on completion.
 
PX_INLINE void setContinuation (PxBaseTask *c)
 Initialize this task and specify the task that will have its ref count decremented on completion.
 
PX_INLINE PxBaseTask * getContinuation () const
 Retrieves continuation task.
 
virtual void removeReference () PX_OVERRIDE
 Manually decrement this task's reference count. If the reference count reaches zero, the task will be dispatched.
 
virtual int32_t getReference () const PX_OVERRIDE
 Return the ref-count for this task.
 
virtual void addReference () PX_OVERRIDE
 Manually increment this task's reference count. The task will not be allowed to run until removeReference() is called.
 
virtual void release () PX_OVERRIDE
 called by CpuDispatcher after run method has completed
 
- Public Member Functions inherited from physx::PxBaseTask
virtual void run ()=0
 The user-implemented run method where the task's work should be performed.
 
virtual const char * getName () const =0
 Return a user-provided task name for profiling purposes.
 
PX_FORCE_INLINE PxTaskManager * getTaskManager () const
 Return PxTaskManager to which this task was submitted.
 
PX_FORCE_INLINE void setContextId (PxU64 id)
 
PX_FORCE_INLINE PxU64 getContextId () const
 

Protected Attributes

PxBaseTask * mCont
 Continuation task, can be NULL.
 
volatile int32_t mRefCount
 PxTask is dispatched when reaches 0.
 
- Protected Attributes inherited from physx::PxBaseTask
PxU64 mContextID
 Context ID for profiler interface.
 
PxTaskManager * mTm
 Owning PxTaskManager instance.
 

Friends

class PxTaskMgr
 

Detailed Description

A PxBaseTask implementation with immediate execution and simple dependencies.

A PxLightCpuTask bypasses the PxTaskManager launch dependencies and will be submitted directly to your scene's CpuDispatcher. When the run() function completes, it will decrement the reference count of the specified continuation task.

You must use a full-blown PxTask if you want your task to be resolved by another PxTask, or you need more than a single dependency to be resolved when your task completes, or your task will not run on the CpuDispatcher.

Member Function Documentation

◆ addReference()

virtual void physx::PxLightCpuTask::addReference ( )
inlinevirtual

Manually increment this task's reference count. The task will not be allowed to run until removeReference() is called.

Implements physx::PxBaseTask.

◆ getReference()

virtual int32_t physx::PxLightCpuTask::getReference ( ) const
inlinevirtual

Return the ref-count for this task.

Implements physx::PxBaseTask.

◆ release()

virtual void physx::PxLightCpuTask::release ( )
inlinevirtual

called by CpuDispatcher after run method has completed

Decrements the continuation task's reference count, if specified.

Implements physx::PxBaseTask.

Reimplemented in TaskWait, CallbackFinishTask, SubstepCompletionTask, TaskWait, PxsCMUpdateTask, physx::Dy::DynamicsMergeTask, and physx::Dy::SetStepperTask.

◆ removeReference()

virtual void physx::PxLightCpuTask::removeReference ( )
inlinevirtual

Manually decrement this task's reference count. If the reference count reaches zero, the task will be dispatched.

Implements physx::PxBaseTask.

◆ setContinuation() [1/2]

PX_INLINE void physx::PxLightCpuTask::setContinuation ( PxBaseTask *  c)
inline

Initialize this task and specify the task that will have its ref count decremented on completion.

This overload of setContinuation() queries the PxTaskManager from the continuation task, which cannot be NULL.

Parameters
[in]cThe task to be executed after this task has finished running

◆ setContinuation() [2/2]

PX_INLINE void physx::PxLightCpuTask::setContinuation ( PxTaskManager &  tm,
PxBaseTask *  c 
)
inline

Initialize this task and specify the task that will have its ref count decremented on completion.

Submission is deferred until the task's mRefCount is decremented to zero.
Note that we only use the PxTaskManager to query the appropriate dispatcher.

Parameters
[in]tmThe PxTaskManager this task is managed by
[in]cThe task to be executed when this task has finished running

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