Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
BufferVK.h
Go to the documentation of this file.
1// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
2// SPDX-FileCopyrightText: 2024 Jorrit Rouwe
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
10
12
14class MemoryVK : public RefTarget<MemoryVK>, public NonCopyable
15{
16public:
18
20 {
21 // We should have unmapped and freed the block before destruction
23 JPH_ASSERT(mMemory == VK_NULL_HANDLE);
24 }
25
26 VkDeviceMemory mMemory = VK_NULL_HANDLE;
27 VkDeviceSize mSize = 0;
28 VkDeviceSize mBufferSize = 0;
29 VkMemoryPropertyFlags mProperties = 0;
30 int mMappedCount = 0;
31 void * mMappedPtr = nullptr;
32};
33
36{
37public:
39 VkBuffer mBuffer = VK_NULL_HANDLE;
40 VkDeviceSize mOffset = 0;
41 VkDeviceSize mSize = 0;
42};
43
#define JPH_NAMESPACE_END
Definition Core.h:487
#define JPH_NAMESPACE_BEGIN
Definition Core.h:481
#define JPH_ASSERT(...)
Definition IssueReporting.h:28
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition Memory.h:51
Simple wrapper class to manage a Vulkan buffer.
Definition BufferVK.h:36
VkBuffer mBuffer
The Vulkan buffer handle.
Definition BufferVK.h:39
VkDeviceSize mOffset
Offset in the memory block where the buffer starts.
Definition BufferVK.h:40
Ref< MemoryVK > mMemory
The memory block that contains the buffer (note that filling this in is optional if you do your own b...
Definition BufferVK.h:38
VkDeviceSize mSize
Real size of the buffer.
Definition BufferVK.h:41
Simple wrapper class to manage a Vulkan memory block.
Definition BufferVK.h:15
VkDeviceSize mBufferSize
Size of each of the buffers that this memory block has been divided into.
Definition BufferVK.h:28
int mMappedCount
How often buffers using this memory block were mapped.
Definition BufferVK.h:30
VkDeviceMemory mMemory
The Vulkan memory handle.
Definition BufferVK.h:26
VkMemoryPropertyFlags mProperties
Vulkan memory properties used to allocate this block.
Definition BufferVK.h:29
JPH_OVERRIDE_NEW_DELETE ~MemoryVK()
Definition BufferVK.h:19
VkDeviceSize mSize
Size of the memory block.
Definition BufferVK.h:27
void * mMappedPtr
The CPU address of the memory block when mapped.
Definition BufferVK.h:31
NonCopyable()=default
Definition Reference.h:110