From bb3ab7d66c9fb6c5e74da3210176c3d21ac40c62 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Tue, 26 Feb 2019 13:37:08 -0300 Subject: [PATCH 1/2] gl_state: Fixup multibind bug --- src/video_core/renderer_opengl/gl_state.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp index 219f080532..9419326a3a 100644 --- a/src/video_core/renderer_opengl/gl_state.cpp +++ b/src/video_core/renderer_opengl/gl_state.cpp @@ -461,7 +461,7 @@ void OpenGLState::ApplyTextures() const { if (has_delta) { glBindTextures(static_cast(first), static_cast(last - first + 1), - textures.data()); + textures.data() + first); } } @@ -482,7 +482,7 @@ void OpenGLState::ApplySamplers() const { } if (has_delta) { glBindSamplers(static_cast(first), static_cast(last - first + 1), - samplers.data()); + samplers.data() + first); } } From e85066dac79176092fcdade32f1378740dec39a8 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Tue, 26 Feb 2019 13:37:23 -0300 Subject: [PATCH 2/2] gl_rasterizer: Remove texture unbinding after dispatching a draw call Unbinding was required when OpenGL delete operations didn't unbind a resource if it was bound. This is no longer needed and can be removed. --- src/video_core/renderer_opengl/gl_rasterizer.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index c8c1d6911a..321d9dd3da 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -739,22 +739,10 @@ void RasterizerOpenGL::DrawArrays() { state.Apply(); res_cache.SignalPreDrawCall(); - - // Execute draw call params.DispatchDraw(); - res_cache.SignalPostDrawCall(); - // Disable scissor test - state.viewports[0].scissor.enabled = false; - accelerate_draw = AccelDraw::Disabled; - - // Unbind textures for potential future use as framebuffer attachments - for (auto& texture_unit : state.texture_units) { - texture_unit.Unbind(); - } - state.Apply(); } void RasterizerOpenGL::FlushAll() {}