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 {
19 // We should have unmapped and freed the block before destruction
21 JPH_ASSERT(mMemory == VK_NULL_HANDLE);
22 }
23
24 VkDeviceMemory mMemory = VK_NULL_HANDLE;
25 VkDeviceSize mSize = 0;
26 VkDeviceSize mBufferSize = 0;
27 VkMemoryPropertyFlags mProperties = 0;
28 int mMappedCount = 0;
29 void * mMappedPtr = nullptr;
30};
31
34{
35public:
37 VkBuffer mBuffer = VK_NULL_HANDLE;
38 VkDeviceSize mOffset = 0;
39 VkDeviceSize mSize = 0;
40};
41
#define JPH_NAMESPACE_END
Definition Core.h:425
#define JPH_NAMESPACE_BEGIN
Definition Core.h:419
#define JPH_ASSERT(...)
Definition IssueReporting.h:33
Simple wrapper class to manage a Vulkan buffer.
Definition BufferVK.h:34
VkBuffer mBuffer
The Vulkan buffer handle.
Definition BufferVK.h:37
VkDeviceSize mOffset
Offset in the memory block where the buffer starts.
Definition BufferVK.h:38
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:36
VkDeviceSize mSize
Real size of the buffer.
Definition BufferVK.h:39
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:26
int mMappedCount
How often buffers using this memory block were mapped.
Definition BufferVK.h:28
VkDeviceMemory mMemory
The Vulkan memory handle.
Definition BufferVK.h:24
VkMemoryPropertyFlags mProperties
Vulkan memory properties used to allocate this block.
Definition BufferVK.h:27
~MemoryVK()
Definition BufferVK.h:17
VkDeviceSize mSize
Size of the memory block.
Definition BufferVK.h:25
void * mMappedPtr
The CPU address of the memory block when mapped.
Definition BufferVK.h:29
Class that makes another class non-copyable. Usage: Inherit from NonCopyable.
Definition NonCopyable.h:11
Definition Reference.h:107
Definition Reference.h:35