Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
ComputeBufferCPU.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
14class JPH_EXPORT ComputeBufferCPU final : public ComputeBuffer
15{
16public:
18
20 ComputeBufferCPU(EType inType, uint64 inSize, uint inStride, const void *inData);
21 virtual ~ComputeBufferCPU() override;
22
24
25 void * GetData() const { return mData; }
26
27private:
28 virtual void * MapInternal(EMode inMode) override { return mData; }
29 virtual void UnmapInternal() override { /* Nothing to do */ }
30
31 void * mData;
32};
33
35
36#endif // JPH_USE_CPU_COMPUTE
#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
#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
Buffer that can be read from / written to by a compute shader.
Definition ComputeBuffer.h:18
virtual ComputeBufferResult CreateReadBackBuffer() const =0
virtual void * MapInternal(EMode inMode)=0
virtual void UnmapInternal()=0
Helper class that either contains a valid result or an error.
Definition Result.h:12