|
SleakEngine 1.0.0
C++23 multi-backend game engine
|
VMA-backed Vulkan buffer with staging uploads, batched copies, and a size-bucketed recycling pool. More...
#include <VulkanBuffer.hpp>
Classes | |
| struct | AsyncFlushResult |
| Result of an async batched flush: the recorded command buffer plus staging resources to free later. More... | |
| struct | PendingStagingCleanup |
| A staging buffer awaiting release once its async copy has completed. More... | |
Public Member Functions | |
| VulkanBuffer (VkDevice device, VkPhysicalDevice physicalDevice, uint32_t size, BufferType type, VkCommandPool commandPool, VkQueue graphicsQueue) | |
| ~VulkanBuffer () override | |
| void | Cleanup () override |
| void * | GetData () override |
| VkBuffer | GetVkBuffer () const |
| bool | Initialize (void *data) override |
| Allocates the buffer (recycling a pooled one if a match exists) and uploads initial data, if any. | |
| bool | Map () override |
| Maps host-visible memory for direct CPU writes. | |
| void | Unmap () override |
| void | Update () override |
| void | Update (void *data, size_t size) override |
| Overwrites buffer contents, staging through a temporary buffer for device-local memory. | |
| Public Member Functions inherited from Sleak::RenderEngine::BufferBase | |
| const void * | GetCPUShadowCopy () const |
| size_t | GetCPUShadowCopySize () const |
| size_t | GetSize () |
| int | GetSlot () const |
| BufferType | GetType () |
| uint32_t | GetVertexFormat () const |
| Registered custom vertex layout of this buffer; 0 means the engine default Vertex. | |
| void | SetSlot (int slot) |
| void | SetVertexFormat (uint32_t handle) |
| Tags the buffer with a VertexFormatRegistry handle so backends pick the matching pipeline. | |
| void | StoreCPUShadowCopy (const void *data, size_t size) |
| Copies up to 128 bytes into the inline shadow-copy storage, clamping oversized input. | |
| Public Member Functions inherited from Sleak::ResourceBase | |
| virtual | ~ResourceBase ()=default |
Static Public Member Functions | |
| static void | AdvanceDeletionFrame () |
| static void | DestroyAllocator () |
| static void | DumpPerFrameAllocStats () |
| static void | FlushAllDeferredDeletions () |
| static void | FlushPendingCopies () |
| static AsyncFlushResult | FlushPendingCopiesAsync (VkSemaphore signalSemaphore) |
| static VmaAllocator | GetAllocator () |
| static VkDeviceSize | GetDeviceLocalAllocatedBytes () |
| static VkDeviceSize | GetDeviceLocalHeapSize () |
| static VkDeviceSize | GetTotalAllocatedBytes () |
| static void | InitAllocator (VkInstance instance, VkPhysicalDevice physicalDevice, VkDevice device) |
| static void | ProcessDeferredDeletions (uint32_t maxFramesInFlight) |
| static void | SetBatchingEnabled (bool enabled) |
| static void | SetPhysicalDevice (VkPhysicalDevice device) |
| static void | UntrackAllocation (VkDeviceSize size) |
| static void | UntrackAllocation (VkDeviceSize size, uint32_t memTypeIdx) |
Additional Inherited Members | |
| Protected Attributes inherited from Sleak::RenderEngine::BufferBase | |
| bool | bIsMapped = false |
| void * | Data = nullptr |
| const void * | m_cpuShadowCopy = nullptr |
| size_t | m_cpuShadowCopySize = 0 |
| char | m_cpuShadowStorage [128] = {} |
| uint32_t | m_vertexFormat = 0 |
| size_t | Size = 0 |
| int | Slot = 0 |
| BufferType | Type |
| Protected Attributes inherited from Sleak::ResourceBase | |
| bool | bIsInitialized |
| std::string | Name |
VMA-backed Vulkan buffer with staging uploads, batched copies, and a size-bucketed recycling pool.
Definition at line 13 of file VulkanBuffer.hpp.
| Sleak::RenderEngine::VulkanBuffer::VulkanBuffer | ( | VkDevice | device, |
| VkPhysicalDevice | physicalDevice, | ||
| uint32_t | size, | ||
| BufferType | type, | ||
| VkCommandPool | commandPool, | ||
| VkQueue | graphicsQueue ) |
Definition at line 94 of file VulkanBuffer.cpp.
|
override |
Definition at line 105 of file VulkanBuffer.cpp.
|
inlinestatic |
Definition at line 163 of file VulkanBuffer.hpp.
|
overridevirtual |
Implements Sleak::ResourceBase.
Definition at line 308 of file VulkanBuffer.cpp.
|
static |
Definition at line 33 of file VulkanBuffer.cpp.
|
static |
Definition at line 803 of file VulkanBuffer.cpp.
|
static |
Definition at line 779 of file VulkanBuffer.cpp.
|
static |
Definition at line 546 of file VulkanBuffer.cpp.
|
static |
Definition at line 582 of file VulkanBuffer.cpp.
|
inlinestatic |
Definition at line 40 of file VulkanBuffer.hpp.
|
overridevirtual |
Implements Sleak::RenderEngine::BufferBase.
Definition at line 370 of file VulkanBuffer.cpp.
|
static |
Definition at line 835 of file VulkanBuffer.cpp.
|
static |
Definition at line 805 of file VulkanBuffer.cpp.
|
static |
Definition at line 799 of file VulkanBuffer.cpp.
|
inline |
Definition at line 33 of file VulkanBuffer.hpp.
|
static |
Definition at line 18 of file VulkanBuffer.cpp.
|
overridevirtual |
Allocates the buffer (recycling a pooled one if a match exists) and uploads initial data, if any.
Implements Sleak::ResourceBase.
Definition at line 109 of file VulkanBuffer.cpp.
|
overridevirtual |
Maps host-visible memory for direct CPU writes.
Implements Sleak::RenderEngine::BufferBase.
Definition at line 345 of file VulkanBuffer.cpp.
|
static |
Definition at line 630 of file VulkanBuffer.cpp.
|
inlinestatic |
Definition at line 66 of file VulkanBuffer.hpp.
|
static |
Definition at line 821 of file VulkanBuffer.cpp.
|
overridevirtual |
Implements Sleak::RenderEngine::BufferBase.
Definition at line 358 of file VulkanBuffer.cpp.
|
inlinestatic |
Definition at line 170 of file VulkanBuffer.hpp.
|
inlinestatic |
Definition at line 171 of file VulkanBuffer.hpp.
|
overridevirtual |
Implements Sleak::RenderEngine::BufferBase.
Definition at line 267 of file VulkanBuffer.cpp.
|
overridevirtual |
Overwrites buffer contents, staging through a temporary buffer for device-local memory.
Implements Sleak::RenderEngine::BufferBase.
Definition at line 272 of file VulkanBuffer.cpp.