9#ifdef JPH_USE_CPU_COMPUTE
28 using CreateShader = ComputeShaderCPU::CreateShader;
30 void RegisterShader(
const char *inName, CreateShader inCreateShader)
32 mShaderRegistry[inName] = inCreateShader;
37 ShaderRegistry mShaderRegistry;
41#define JPH_SHADER_WRAPPER_FUNCTION_NAME(name) RegisterShader##name
42#define JPH_SHADER_WRAPPER_FUNCTION(sys, name) void JPH_EXPORT JPH_SHADER_WRAPPER_FUNCTION_NAME(name)(ComputeSystemCPU *sys)
45#define JPH_DECLARE_REGISTER_SHADER(name) namespace JPH { class ComputeSystemCPU; JPH_SHADER_WRAPPER_FUNCTION(, name); }
48#define JPH_REGISTER_SHADER(sys, name) JPH::JPH_SHADER_WRAPPER_FUNCTION_NAME(name)(sys)
#define JPH_EXPORT
Definition Core.h:275
std::uint64_t uint64
Definition Core.h:504
unsigned int uint
Definition Core.h:500
#define JPH_NAMESPACE_END
Definition Core.h:425
std::uint32_t uint32
Definition Core.h:503
#define JPH_NAMESPACE_BEGIN
Definition Core.h:419
#define JPH_DECLARE_RTTI_VIRTUAL(linkage, class_name)
Definition RTTI.h:245
EType
Type of buffer.
Definition ComputeBuffer.h:24
Interface to run a workload on the GPU.
Definition ComputeSystem.h:16
virtual ComputeQueueResult CreateComputeQueue()=0
Create a queue for executing compute shaders.
virtual ComputeBufferResult CreateComputeBuffer(ComputeBuffer::EType inType, uint64 inSize, uint inStride, const void *inData=nullptr)=0
Create a buffer for use with a compute shader.
virtual ComputeShaderResult CreateComputeShader(const char *inName, uint32 inGroupSizeX, uint32 inGroupSizeY=1, uint32 inGroupSizeZ=1)=0
Compile a compute shader.
Helper class that either contains a valid result or an error.
Definition Result.h:12
Definition UnorderedMap.h:31