Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
VulkanMemoryPoolBuffer.hpp
1/*
2Copyright (C) 2019,2021,2025,2026 Rodrigo Jose Hernandez Cordoba
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16#ifndef AEONGAMES_VULKANMEMORYPOOLBUFFER_HPP
17#define AEONGAMES_VULKANMEMORYPOOLBUFFER_HPP
18#include <cstdint>
19#include <string>
20#include <vector>
21#include <tuple>
22#include <initializer_list>
23#include <vulkan/vulkan.h>
24#include "VulkanBuffer.hpp"
25#include "aeongames/MemoryPoolBuffer.hpp"
26
27namespace AeonGames
28{
29 class VulkanRenderer;
32 {
33 public:
35 VulkanMemoryPoolBuffer ( const VulkanRenderer& aVulkanRenderer, size_t aStackSize );
40 VulkanMemoryPoolBuffer& operator= ( const VulkanMemoryPoolBuffer& ) = delete;
41 VulkanMemoryPoolBuffer& operator = ( VulkanMemoryPoolBuffer&& ) = delete;
44 void Initialize ( size_t aStackSize );
46 void Finalize();
48 const VkDescriptorSet& GetDescriptorSet() const;
49 BufferAccessor Allocate ( size_t aSize ) final;
50 void Reset() final;
51 const Buffer& GetBuffer() const final;
52 private:
53 void InitializeDescriptorPool();
54 void FinalizeDescriptorPool();
55 void InitializeDescriptorSet();
56 const VulkanRenderer& mVulkanRenderer;
57 size_t mOffset{0};
58 VkDescriptorPool mVkDescriptorPool{ VK_NULL_HANDLE };
59 VkDescriptorSet mVkDescriptorSet{ VK_NULL_HANDLE };
60 VulkanBuffer mUniformBuffer;
61 };
62}
63#endif
Provides access to a region within a memory pool buffer.
Abstract interface for GPU/memory buffer operations.
Definition Buffer.hpp:24
Abstract interface for a pool-based buffer allocator.
Vulkan GPU buffer wrapper implementing the Buffer interface.
const VkDescriptorSet & GetDescriptorSet() const
Get the Vulkan descriptor set for this pool buffer.
void Initialize(size_t aStackSize)
Initialize the pool buffer with the given size.
VulkanMemoryPoolBuffer(const VulkanRenderer &aVulkanRenderer, size_t aStackSize)
Construct with a renderer and initial pool size.
const Buffer & GetBuffer() const final
Get a reference to the underlying Buffer.
void Finalize()
Release pool buffer and descriptor resources.
BufferAccessor Allocate(size_t aSize) final
Allocate a sub-region from the memory pool.
void Reset() final
Reset the pool, freeing all previous allocations.
Vulkan rendering backend implementing the Renderer interface.
<- This is here just for the literals
Definition AABB.hpp:31