From 9994ccb3422b88649eb160bf373d4d29b08a4768 Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Sat, 8 Nov 2014 15:08:41 +0100 Subject: [PATCH] PostProcessing: Invalidate shader when anaglyph stereoscopy is toggled. --- Source/Core/VideoBackends/OGL/PostProcessing.cpp | 5 ++++- Source/Core/VideoBackends/OGL/PostProcessing.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Core/VideoBackends/OGL/PostProcessing.cpp b/Source/Core/VideoBackends/OGL/PostProcessing.cpp index 84088459ed..80bdf8eef4 100644 --- a/Source/Core/VideoBackends/OGL/PostProcessing.cpp +++ b/Source/Core/VideoBackends/OGL/PostProcessing.cpp @@ -38,6 +38,7 @@ static char s_vertex_shader[] = OpenGLPostProcessing::OpenGLPostProcessing() : m_initialized(false) + , m_anaglyph(false) { CreateHeader(); @@ -160,7 +161,8 @@ void OpenGLPostProcessing::BlitFromTexture(TargetRectangle src, TargetRectangle void OpenGLPostProcessing::ApplyShader() { // shader didn't changed - if (m_initialized && m_config.GetShader() == g_ActiveConfig.sPostProcessingShader) + if (m_initialized && m_config.GetShader() == g_ActiveConfig.sPostProcessingShader && + ((g_ActiveConfig.iStereoMode == STEREO_ANAGLYPH) == m_anaglyph)) return; m_shader.Destroy(); @@ -222,6 +224,7 @@ void OpenGLPostProcessing::ApplyShader() std::string glsl_name = "option_" + it.first; m_uniform_bindings[it.first] = glGetUniformLocation(m_shader.glprogid, glsl_name.c_str()); } + m_anaglyph = g_ActiveConfig.iStereoMode == STEREO_ANAGLYPH; m_initialized = true; } diff --git a/Source/Core/VideoBackends/OGL/PostProcessing.h b/Source/Core/VideoBackends/OGL/PostProcessing.h index 4c67eca839..e2be0bdc7d 100644 --- a/Source/Core/VideoBackends/OGL/PostProcessing.h +++ b/Source/Core/VideoBackends/OGL/PostProcessing.h @@ -28,6 +28,7 @@ public: private: bool m_initialized; + bool m_anaglyph; SHADER m_shader; GLuint m_uniform_resolution; GLuint m_uniform_src_rect;