![]() |
Kale
|
#include <DeviceMemory.hpp>
Public Member Functions | |
DeviceMemory () | |
DeviceMemory (Device &device, const vk::MemoryRequirements &requirements, vk::MemoryPropertyFlags properties) | |
void | init (Device &device, const vk::MemoryRequirements &requirements, vk::MemoryPropertyFlags properties) |
DeviceMemory (Device &device, vk::MemoryRequirements &&requirements, vk::MemoryPropertyFlags properties) | |
void | init (Device &device, vk::MemoryRequirements &&requirements, vk::MemoryPropertyFlags properties) |
void | freeResources (bool remove=true) override |
![]() | |
virtual | ~ParentResource () |
void | freeChildren () |
Public Attributes | |
vk::UniqueDeviceMemory | deviceMemory |
vk::MemoryRequirements | memoryInfo |
vk::MemoryPropertyFlags | memoryProperties |
Private Member Functions | |
void | allocateMemory () |
Additional Inherited Members | |
![]() | |
ChildResource () | |
ChildResource (Device &parent) | |
virtual void | init (Device &parent) |
~ChildResource () | |
![]() | |
std::list< ChildResource< DeviceMemory > * > | resources |
![]() | |
Device * | parentPtr |
Handles physical device memory allocation and deletion automatically using RAII to avoid memory leaks TODO - Delete this class and create a device memory pool class See https://www.youtube.com/watch?v=rXSdDE7NWmA for more info - getting memory is expensive so a pool can help FPS a ton
Definition at line 38 of file DeviceMemory.hpp.
DeviceMemory::DeviceMemory | ( | ) |
Creates an uninitialized object
Definition at line 29 of file DeviceMemory.cpp.
DeviceMemory::DeviceMemory | ( | Device & | device, |
const vk::MemoryRequirements & | requirements, | ||
vk::MemoryPropertyFlags | properties ) |
Creates and initializes the device memory object
device | The device to allocate the memory on |
requirements | The requirements of the memory to allocate |
properties | Properties regarding the memory to allocate |
Definition at line 39 of file DeviceMemory.cpp.
DeviceMemory::DeviceMemory | ( | Device & | device, |
vk::MemoryRequirements && | requirements, | ||
vk::MemoryPropertyFlags | properties ) |
Creates and initializes the device memory object
device | The device to allocate the memory on |
requirements | The requirements of the memory to allocate |
properties | Properties regarding the memory to allocate |
Definition at line 63 of file DeviceMemory.cpp.
|
private |
Allocates memory into the device memory
Definition at line 84 of file DeviceMemory.cpp.
|
overridevirtual |
Frees the memory on the device
Reimplemented from Kale::Vulkan::ChildResource< Device >.
Definition at line 93 of file DeviceMemory.cpp.
void DeviceMemory::init | ( | Device & | device, |
const vk::MemoryRequirements & | requirements, | ||
vk::MemoryPropertyFlags | properties ) |
Initializes the device memory object
device | The device to allocate the memory on |
requirements | The requirements of the memory to allocate |
properties | Properties regarding the memory to allocate |
Definition at line 50 of file DeviceMemory.cpp.
void DeviceMemory::init | ( | Device & | device, |
vk::MemoryRequirements && | requirements, | ||
vk::MemoryPropertyFlags | properties ) |
Initializes the device memory object
device | The device to allocate the memory on |
requirements | The requirements of the memory to allocate |
properties | Properties regarding the memory to allocate |
Definition at line 74 of file DeviceMemory.cpp.
vk::UniqueDeviceMemory Kale::Vulkan::DeviceMemory::deviceMemory |
The device memory block
Definition at line 88 of file DeviceMemory.hpp.
vk::MemoryRequirements Kale::Vulkan::DeviceMemory::memoryInfo |
The size of the memory block
Definition at line 93 of file DeviceMemory.hpp.
vk::MemoryPropertyFlags Kale::Vulkan::DeviceMemory::memoryProperties |
The properties of the memory, ie vram or ram, etc
Definition at line 98 of file DeviceMemory.hpp.