diff options
author | bunnei <bunneidev@gmail.com> | 2018-03-19 22:10:59 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-03-20 04:14:02 +0100 |
commit | 0e4b9cdde408871f542a2a3093963ebbaa007d33 (patch) | |
tree | c183a90182c5a0ba32b5787bdbc1dfc35a4f6ffb /src/video_core/renderer_opengl/gl_stream_buffer.h | |
parent | externals: Update Glad to latest version used by Citra. (diff) | |
download | yuzu-0e4b9cdde408871f542a2a3093963ebbaa007d33.tar yuzu-0e4b9cdde408871f542a2a3093963ebbaa007d33.tar.gz yuzu-0e4b9cdde408871f542a2a3093963ebbaa007d33.tar.bz2 yuzu-0e4b9cdde408871f542a2a3093963ebbaa007d33.tar.lz yuzu-0e4b9cdde408871f542a2a3093963ebbaa007d33.tar.xz yuzu-0e4b9cdde408871f542a2a3093963ebbaa007d33.tar.zst yuzu-0e4b9cdde408871f542a2a3093963ebbaa007d33.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_stream_buffer.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_stream_buffer.h b/src/video_core/renderer_opengl/gl_stream_buffer.h new file mode 100644 index 000000000..4bc2f52e0 --- /dev/null +++ b/src/video_core/renderer_opengl/gl_stream_buffer.h @@ -0,0 +1,34 @@ +// Copyright 2018 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include <memory> +#include <glad/glad.h> +#include "common/common_types.h" +#include "video_core/renderer_opengl/gl_resource_manager.h" + +class OGLStreamBuffer : private NonCopyable { +public: + explicit OGLStreamBuffer(GLenum target); + virtual ~OGLStreamBuffer() = default; + +public: + static std::unique_ptr<OGLStreamBuffer> MakeBuffer(bool storage_buffer, GLenum target); + + virtual void Create(size_t size, size_t sync_subdivide) = 0; + virtual void Release() {} + + GLuint GetHandle() const; + + virtual std::pair<u8*, GLintptr> Map(size_t size, size_t alignment) = 0; + virtual void Unmap() = 0; + +protected: + OGLBuffer gl_buffer; + GLenum gl_target; + + size_t buffer_pos = 0; + size_t buffer_size = 0; + size_t buffer_sync_subdivide = 0; + size_t mapped_size = 0; +}; |