// Copyright (C) 2020 Jérôme Leclercq // This file is part of the "Nazara Engine - Renderer module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once #ifndef NAZARA_OPENGLRENDERER_OPENGLUPLOADPOOL_HPP #define NAZARA_OPENGLRENDERER_OPENGLUPLOADPOOL_HPP #include #include #include #include #include #include namespace Nz { class NAZARA_OPENGLRENDERER_API OpenGLUploadPool : public UploadPool { public: inline OpenGLUploadPool(UInt64 blockSize); OpenGLUploadPool(const OpenGLUploadPool&) = delete; OpenGLUploadPool(OpenGLUploadPool&&) noexcept = default; ~OpenGLUploadPool() = default; Allocation& Allocate(UInt64 size) override; Allocation& Allocate(UInt64 size, UInt64 alignment) override; void Reset() override; OpenGLUploadPool& operator=(const OpenGLUploadPool&) = delete; OpenGLUploadPool& operator=(OpenGLUploadPool&&) = delete; private: struct Block { std::vector memory; UInt64 freeOffset = 0; }; std::vector m_blocks; std::vector m_allocations; UInt64 m_blockSize; }; } #include #endif // NAZARA_OPENGLRENDERER_OPENGLUPLOADPOOL_HPP