Implement some classes

This commit is contained in:
Lynix
2020-04-19 01:37:56 +02:00
parent 5c3eb31d4a
commit 4dc8920a73
24 changed files with 138 additions and 951 deletions

View File

@@ -9,9 +9,8 @@
#include <Nazara/Prerequisites.hpp>
#include <Nazara/Core/MovablePtr.hpp>
#include <Nazara/OpenGLRenderer/Config.hpp>
#include <Nazara/Renderer/UploadPool.hpp>
#include <Nazara/OpenGLRenderer/Wrapper/Buffer.hpp>
#include <Nazara/OpenGLRenderer/Wrapper/DeviceMemory.hpp>
#include <optional>
#include <vector>
@@ -20,18 +19,13 @@ namespace Nz
class NAZARA_OPENGLRENDERER_API OpenGLUploadPool : public UploadPool
{
public:
struct OpenGLAllocation : Allocation
{
VkBuffer buffer;
};
inline OpenGLUploadPool(Vk::Device& device, UInt64 blockSize);
inline OpenGLUploadPool(UInt64 blockSize);
OpenGLUploadPool(const OpenGLUploadPool&) = delete;
OpenGLUploadPool(OpenGLUploadPool&&) noexcept = default;
~OpenGLUploadPool() = default;
OpenGLAllocation& Allocate(UInt64 size) override;
OpenGLAllocation& Allocate(UInt64 size, UInt64 alignment) override;
Allocation& Allocate(UInt64 size) override;
Allocation& Allocate(UInt64 size, UInt64 alignment) override;
void Reset() override;
@@ -41,15 +35,11 @@ namespace Nz
private:
struct Block
{
Vk::DeviceMemory blockMemory;
Vk::Buffer buffer;
//< TODO
UInt64 freeOffset;
};
UInt64 m_blockSize;
Vk::Device& m_device;
std::vector<Block> m_blocks;
std::vector<OpenGLAllocation> m_allocations;
};
}