From 0838c87dacdb8355ca9a2d7a812d18a58087aac8 Mon Sep 17 00:00:00 2001 From: Markus Wick Date: Sat, 19 May 2018 15:40:46 +0200 Subject: [PATCH] gl_stream_buffer: Only flush the host buffer if anything was written. This might happen in the new TBO upload path. --- src/video_core/renderer_opengl/gl_stream_buffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video_core/renderer_opengl/gl_stream_buffer.cpp b/src/video_core/renderer_opengl/gl_stream_buffer.cpp index 1957cfbcc0..03a8ed8b7f 100644 --- a/src/video_core/renderer_opengl/gl_stream_buffer.cpp +++ b/src/video_core/renderer_opengl/gl_stream_buffer.cpp @@ -87,7 +87,7 @@ std::tuple OGLStreamBuffer::Map(GLsizeiptr size, GLintptr a void OGLStreamBuffer::Unmap(GLsizeiptr size) { ASSERT(size <= mapped_size); - if (!coherent) { + if (!coherent && size > 0) { glFlushMappedBufferRange(gl_target, buffer_pos - mapped_offset, size); }