diff options
author | Zach Hilman <DarkLordZach@users.noreply.github.com> | 2019-07-05 19:39:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-05 19:39:13 +0200 |
commit | 772c86a260eb446b0fe4232b0a50666511bef25c (patch) | |
tree | 013d92268c06454c93565c83eff2b79b56a00839 /src/video_core/renderer_opengl/gl_resource_manager.h | |
parent | Merge pull request #2669 from FearlessTobi/move-cpujit-setting (diff) | |
parent | texture_cache: Address Feedback (diff) | |
download | yuzu-772c86a260eb446b0fe4232b0a50666511bef25c.tar yuzu-772c86a260eb446b0fe4232b0a50666511bef25c.tar.gz yuzu-772c86a260eb446b0fe4232b0a50666511bef25c.tar.bz2 yuzu-772c86a260eb446b0fe4232b0a50666511bef25c.tar.lz yuzu-772c86a260eb446b0fe4232b0a50666511bef25c.tar.xz yuzu-772c86a260eb446b0fe4232b0a50666511bef25c.tar.zst yuzu-772c86a260eb446b0fe4232b0a50666511bef25c.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_resource_manager.h')
-rw-r--r-- | src/video_core/renderer_opengl/gl_resource_manager.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_resource_manager.h b/src/video_core/renderer_opengl/gl_resource_manager.h index fbb93ee49..3a85a1d4c 100644 --- a/src/video_core/renderer_opengl/gl_resource_manager.h +++ b/src/video_core/renderer_opengl/gl_resource_manager.h @@ -36,6 +36,31 @@ public: GLuint handle = 0; }; +class OGLTextureView : private NonCopyable { +public: + OGLTextureView() = default; + + OGLTextureView(OGLTextureView&& o) noexcept : handle(std::exchange(o.handle, 0)) {} + + ~OGLTextureView() { + Release(); + } + + OGLTextureView& operator=(OGLTextureView&& o) noexcept { + Release(); + handle = std::exchange(o.handle, 0); + return *this; + } + + /// Creates a new internal OpenGL resource and stores the handle + void Create(); + + /// Deletes the internal OpenGL resource + void Release(); + + GLuint handle = 0; +}; + class OGLSampler : private NonCopyable { public: OGLSampler() = default; @@ -161,6 +186,9 @@ public: /// Deletes the internal OpenGL resource void Release(); + // Converts the buffer into a stream copy buffer with a fixed size + void MakeStreamCopy(std::size_t buffer_size); + GLuint handle = 0; }; |