![]() |
Jolt Physics
A multi core friendly Game Physics Engine
|
A command queue for the CPU compute system. More...
#include <ComputeQueueCPU.h>
Public Member Functions | |
| virtual JPH_OVERRIDE_NEW_DELETE | ~ComputeQueueCPU () override |
| Destructor. | |
| virtual void | SetShader (const ComputeShader *inShader) override |
| virtual void | SetConstantBuffer (const char *inName, const ComputeBuffer *inBuffer) override |
| virtual void | SetBuffer (const char *inName, const ComputeBuffer *inBuffer) override |
| virtual void | SetRWBuffer (const char *inName, ComputeBuffer *inBuffer, EBarrier inBarrier=EBarrier::Yes) override |
| virtual void | ScheduleReadback (ComputeBuffer *inDst, const ComputeBuffer *inSrc) override |
| virtual void | Dispatch (uint inThreadGroupsX, uint inThreadGroupsY, uint inThreadGroupsZ) override |
| Dispatch a compute shader with the specified number of thread groups. | |
| virtual void | Execute () override |
| virtual void | Wait () override |
Public Member Functions inherited from ComputeQueue | |
| virtual JPH_OVERRIDE_NEW_DELETE | ~ComputeQueue ()=default |
| Destructor. | |
| void | ExecuteAndWait () |
Public Member Functions inherited from RefTarget< ComputeQueue > | |
| RefTarget ()=default | |
| Constructor. | |
| RefTarget (const RefTarget &) | |
| ~RefTarget () | |
| assert no one is referencing us | |
| void | SetEmbedded () const |
| RefTarget & | operator= (const RefTarget &) |
| Assignment operator. | |
| uint32 | GetRefCount () const |
| Get current refcount of this object. | |
| void | AddRef () const |
| Add or release a reference to this object. | |
| void | Release () const |
Public Member Functions inherited from NonCopyable | |
| NonCopyable ()=default | |
| NonCopyable (const NonCopyable &)=delete | |
| void | operator= (const NonCopyable &)=delete |
Additional Inherited Members | |
Public Types inherited from ComputeQueue | |
| enum class | EBarrier { Yes , No } |
| If a barrier should be placed before accessing the buffer. More... | |
Static Public Member Functions inherited from RefTarget< ComputeQueue > | |
| static int | sInternalGetRefCountOffset () |
| INTERNAL HELPER FUNCTION USED BY SERIALIZATION. | |
Protected Attributes inherited from RefTarget< ComputeQueue > | |
| atomic< uint32 > | mRefCount |
| Current reference count. | |
Static Protected Attributes inherited from RefTarget< ComputeQueue > | |
| static constexpr uint32 | cEmbedded |
| A large value that gets added to the refcount to mark the object as embedded. | |
A command queue for the CPU compute system.
|
overridevirtual |
Destructor.
|
overridevirtual |
Dispatch a compute shader with the specified number of thread groups.
Implements ComputeQueue.
|
overridevirtual |
Execute accumulated command list. No more commands can be added until Wait is called.
Implements ComputeQueue.
|
overridevirtual |
Schedule buffer to be copied from GPU to CPU. A reference to the buffers is added to make sure they stay alive until execution finishes.
Implements ComputeQueue.
|
overridevirtual |
Bind a read only buffer to the shader. Note that the contents of the buffer cannot be modified on CPU until execution finishes (only relevant for buffers of type UploadBuffer). A reference to the buffer is added to make sure it stays alive until execution finishes.
| inName | Name of the buffer as specified in the shader. |
| inBuffer | The buffer to bind. |
Implements ComputeQueue.
|
overridevirtual |
Bind a constant buffer to the shader. Note that the contents of the buffer cannot be modified until execution finishes. A reference to the buffer is added to make sure it stays alive until execution finishes.
| inName | Name of the buffer as specified in the shader. |
| inBuffer | The buffer to bind. |
Implements ComputeQueue.
|
overridevirtual |
Bind a read/write buffer to the shader. A reference to the buffer is added to make sure it stays alive until execution finishes.
| inName | Name of the buffer as specified in the shader. |
| inBuffer | The buffer to bind. |
| inBarrier | If set to Yes, a barrier will be placed before accessing the buffer to ensure all previous writes to the buffer are visible. |
Implements ComputeQueue.
|
overridevirtual |
Activate a shader. Shader must be set first before buffers can be bound. After every Dispatch call, the shader must be set again and all buffers must be bound again.
Implements ComputeQueue.
|
overridevirtual |
After executing, this waits until execution is done. This also makes sure that any readback operations have completed and the data is available on CPU.
Implements ComputeQueue.