summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_resource_manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_opengl/gl_resource_manager.cpp24
1 files changed, 24 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 bfe666a73..5c96c1d46 100644
--- a/src/video_core/renderer_opengl/gl_resource_manager.cpp
+++ b/src/video_core/renderer_opengl/gl_resource_manager.cpp
@@ -33,6 +33,24 @@ void OGLTexture::Release() {
handle = 0;
}
+void OGLTextureView::Create() {
+ if (handle != 0)
+ return;
+
+ MICROPROFILE_SCOPE(OpenGL_ResourceCreation);
+ glGenTextures(1, &handle);
+}
+
+void OGLTextureView::Release() {
+ if (handle == 0)
+ return;
+
+ MICROPROFILE_SCOPE(OpenGL_ResourceDeletion);
+ glDeleteTextures(1, &handle);
+ OpenGLState::GetCurState().UnbindTexture(handle).Apply();
+ handle = 0;
+}
+
void OGLSampler::Create() {
if (handle != 0)
return;
@@ -130,6 +148,12 @@ void OGLBuffer::Release() {
handle = 0;
}
+void OGLBuffer::MakeStreamCopy(std::size_t buffer_size) {
+ ASSERT_OR_EXECUTE((handle != 0 && buffer_size != 0), { return; });
+
+ glNamedBufferData(handle, buffer_size, nullptr, GL_STREAM_COPY);
+}
+
void OGLSync::Create() {
if (handle != 0)
return;