Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
ComputeShaderCPU.h
Go to the documentation of this file.
1// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
2// SPDX-FileCopyrightText: 2026 Jorrit Rouwe
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
8
9#ifdef JPH_USE_CPU_COMPUTE
10
12
13class ShaderWrapper;
14
16class JPH_EXPORT ComputeShaderCPU : public ComputeShader
17{
18public:
20
21 using CreateShader = ShaderWrapper *(*)();
22
24 ComputeShaderCPU(CreateShader inCreateShader, uint32 inGroupSizeX, uint32 inGroupSizeY, uint32 inGroupSizeZ) :
25 ComputeShader(inGroupSizeX, inGroupSizeY, inGroupSizeZ),
26 mCreateShader(inCreateShader)
27 {
28 }
29
31 ShaderWrapper * CreateWrapper() const
32 {
33 return mCreateShader();
34 }
35
36private:
37 CreateShader mCreateShader;
38};
39
41
42#endif // JPH_USE_CPU_COMPUTE
#define JPH_EXPORT
Definition Core.h:275
#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_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition Memory.h:50
Compute shader handle.
Definition ComputeShader.h:15