diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-06-02 01:12:00 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-06-21 02:38:33 +0200 |
commit | 60bf761afbb125abd324e4b798d18a1611b5777b (patch) | |
tree | 5321727de0bf56eacd99a3917573f36f28197ba4 /src/video_core/renderer_opengl/gl_resource_manager.cpp | |
parent | texture_cache uncompress-compress is untopological. (diff) | |
download | yuzu-60bf761afbb125abd324e4b798d18a1611b5777b.tar yuzu-60bf761afbb125abd324e4b798d18a1611b5777b.tar.gz yuzu-60bf761afbb125abd324e4b798d18a1611b5777b.tar.bz2 yuzu-60bf761afbb125abd324e4b798d18a1611b5777b.tar.lz yuzu-60bf761afbb125abd324e4b798d18a1611b5777b.tar.xz yuzu-60bf761afbb125abd324e4b798d18a1611b5777b.tar.zst yuzu-60bf761afbb125abd324e4b798d18a1611b5777b.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_resource_manager.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_resource_manager.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_resource_manager.cpp b/src/video_core/renderer_opengl/gl_resource_manager.cpp index 9f81c15cb..a1f91d677 100644 --- a/src/video_core/renderer_opengl/gl_resource_manager.cpp +++ b/src/video_core/renderer_opengl/gl_resource_manager.cpp @@ -148,6 +148,14 @@ void OGLBuffer::Release() { handle = 0; } +void OGLBuffer::MakePersistant(std::size_t buffer_size) { + if (handle == 0 || buffer_size == 0) + return; + + const GLbitfield flags = GL_MAP_PERSISTENT_BIT | GL_MAP_WRITE_BIT | GL_MAP_READ_BIT; + glNamedBufferStorage(handle, static_cast<GLsizeiptr>(buffer_size), nullptr, flags); +} + void OGLSync::Create() { if (handle != 0) return; |