diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 50536da02..3f76f74e1 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -647,6 +647,22 @@ bool RasterizerOpenGL::Draw(bool accelerate, bool is_indexed) { } } + // Resolve after drawing, slow initial approach to ensure the MSAA and non-MSAA buffers are + // always in sync + if (framebuffer->color_id != VideoCore::SurfaceId{}) { + Surface& color_surface = res_cache.GetSurface(framebuffer->color_id); + if (color_surface.GetSampleCount() > 1) { + runtime.ResolveTexture(color_surface); + } + } + + if (framebuffer->depth_id != VideoCore::SurfaceId{}) { + Surface& depth_surface = res_cache.GetSurface(framebuffer->depth_id); + if (depth_surface.GetSampleCount() > 1) { + runtime.ResolveTexture(depth_surface); + } + } + vertex_batch.clear(); if (shadow_rendering) { @@ -1009,7 +1025,8 @@ void RasterizerOpenGL::SyncAndUploadLUTs() { } void RasterizerOpenGL::UploadUniforms(bool accelerate_draw) { - // glBindBufferRange also changes the generic buffer binding point, so we sync the state first. + // glBindBufferRange also changes the generic buffer binding point, so we sync the state + // first. state.draw.uniform_buffer = uniform_buffer.GetHandle(); state.Apply(); diff --git a/src/video_core/renderer_opengl/gl_texture_runtime.h b/src/video_core/renderer_opengl/gl_texture_runtime.h index c5120a392..acd922578 100644 --- a/src/video_core/renderer_opengl/gl_texture_runtime.h +++ b/src/video_core/renderer_opengl/gl_texture_runtime.h @@ -78,6 +78,11 @@ public: /// Generates mipmaps for all the available levels of the texture void GenerateMipmaps(Surface& surface); + /// Resolve a surface's MSAA texture into the surface's appropriate non-MSAA texture + void ResolveTexture(Surface& surface) { + blit_helper.ResolveTexture(surface); + } + private: /// Returns the OpenGL driver class const Driver& GetDriver() const {