Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
ComputeSystem Class Referenceabstract

Interface to run a workload on the GPU. More...

#include <ComputeSystem.h>

Inheritance diagram for ComputeSystem:
RefTarget< ComputeSystem > NonCopyable

Public Types

using ShaderLoader = std::function<bool(const char *inName, Array<uint8> &outData)>
 Callback used when loading shaders.
 

Public Member Functions

virtual JPH_OVERRIDE_NEW_DELETE ~ComputeSystem ()=default
 Destructor.
 
virtual Ref< ComputeShaderCreateComputeShader (const char *inName, uint32 inGroupSizeX, uint32 inGroupSizeY=1, uint32 inGroupSizeZ=1)=0
 Compile a compute shader.
 
virtual Ref< ComputeBufferCreateComputeBuffer (ComputeBuffer::EType inType, uint64 inSize, uint inStride, const void *inData=nullptr)=0
 Create a buffer for use with a compute shader.
 
virtual Ref< ComputeQueueCreateComputeQueue ()=0
 Create a queue for executing compute shaders.
 
- Public Member Functions inherited from RefTarget< ComputeSystem >
 RefTarget ()=default
 Constructor.
 
 RefTarget (const RefTarget &)
 
 ~RefTarget ()
 assert no one is referencing us
 
void SetEmbedded () const
 
RefTargetoperator= (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
 

Public Attributes

ShaderLoader mShaderLoader = [](const char *, Array<uint8> &) { JPH_ASSERT(false, "Override this function"); return false; }
 

Additional Inherited Members

- Static Public Member Functions inherited from RefTarget< ComputeSystem >
static int sInternalGetRefCountOffset ()
 INTERNAL HELPER FUNCTION USED BY SERIALIZATION.
 
- Protected Attributes inherited from RefTarget< ComputeSystem >
atomic< uint32mRefCount
 Current reference count.
 
- Static Protected Attributes inherited from RefTarget< ComputeSystem >
static constexpr uint32 cEmbedded
 A large value that gets added to the refcount to mark the object as embedded.
 

Detailed Description

Interface to run a workload on the GPU.

Member Typedef Documentation

◆ ShaderLoader

using ComputeSystem::ShaderLoader = std::function<bool(const char *inName, Array<uint8> &outData)>

Callback used when loading shaders.

Constructor & Destructor Documentation

◆ ~ComputeSystem()

virtual JPH_OVERRIDE_NEW_DELETE ComputeSystem::~ComputeSystem ( )
virtualdefault

Destructor.

Member Function Documentation

◆ CreateComputeBuffer()

virtual Ref< ComputeBuffer > ComputeSystem::CreateComputeBuffer ( ComputeBuffer::EType inType,
uint64 inSize,
uint inStride,
const void * inData = nullptr )
pure virtual

Create a buffer for use with a compute shader.

◆ CreateComputeQueue()

virtual Ref< ComputeQueue > ComputeSystem::CreateComputeQueue ( )
pure virtual

Create a queue for executing compute shaders.

◆ CreateComputeShader()

virtual Ref< ComputeShader > ComputeSystem::CreateComputeShader ( const char * inName,
uint32 inGroupSizeX,
uint32 inGroupSizeY = 1,
uint32 inGroupSizeZ = 1 )
pure virtual

Compile a compute shader.

Member Data Documentation

◆ mShaderLoader

ShaderLoader ComputeSystem::mShaderLoader = [](const char *, Array<uint8> &) { JPH_ASSERT(false, "Override this function"); return false; }

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