From 47dc5e0dabeedc9a080c51214418e4761069ae90 Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 8 Jun 2018 12:22:39 -0500 Subject: Rasterizer: Flush the written region when writing shader uniform data before copying it to the uniform buffers. This fixes the flip_viewport uniform having invalid values when drawing. --- src/video_core/renderer_opengl/gl_rasterizer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 0bd235218..59761c6b1 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -218,6 +218,9 @@ void RasterizerOpenGL::SetupShaders(u8* buffer_ptr, GLintptr buffer_offset) { ubo.SetFromRegs(gpu.state.shader_stages[stage]); std::memcpy(buffer_ptr, &ubo, sizeof(ubo)); + // Flush the buffer so that the GPU can see the data we just wrote. + glFlushMappedBufferRange(GL_ARRAY_BUFFER, buffer_offset, sizeof(ubo)); + // Upload uniform data as one UBO per stage const GLintptr ubo_offset = buffer_offset; copy_buffer(uniform_buffers[stage].handle, ubo_offset, -- cgit v1.2.3