diff --git a/Source/Plugins/Plugin_VideoOGL/Src/PixelShaderCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/PixelShaderCache.cpp index 77edf5521e..4dfda91fd0 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/PixelShaderCache.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/PixelShaderCache.cpp @@ -315,7 +315,6 @@ bool PixelShaderCache::CompilePixelShader(FRAGMENTSHADER& ps, const char* pstrpr //Disable Fragment programs and reset the selected Program void PixelShaderCache::DisableShader() { - CurrentShader = 0; if(ShaderEnabled) { glDisable(GL_FRAGMENT_PROGRAM_ARB); @@ -331,11 +330,11 @@ void PixelShaderCache::SetCurrentShader(GLuint Shader) { glEnable(GL_FRAGMENT_PROGRAM_ARB); ShaderEnabled = true; - CurrentShader = 0; } if(CurrentShader != Shader) { - CurrentShader = Shader; + if(Shader != 0) + CurrentShader = Shader; glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, CurrentShader); } } \ No newline at end of file diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index ba0759392e..a7b5c1a8f1 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -596,8 +596,8 @@ void Renderer::RestoreAPIState() SetColorMask(); SetBlendMode(true); - VertexShaderCache::SetCurrentShader(1); - PixelShaderCache::SetCurrentShader(1); + VertexShaderCache::SetCurrentShader(0); + PixelShaderCache::SetCurrentShader(0); } void Renderer::SetColorMask() diff --git a/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp index 1282385392..08aecd084c 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp @@ -238,7 +238,6 @@ bool VertexShaderCache::CompileVertexShader(VERTEXSHADER& vs, const char* pstrpr void VertexShaderCache::DisableShader() { - CurrentShader = 0; if (ShaderEnabled) { glDisable(GL_VERTEX_PROGRAM_ARB); @@ -252,12 +251,12 @@ void VertexShaderCache::SetCurrentShader(GLuint Shader) if (!ShaderEnabled) { glEnable(GL_VERTEX_PROGRAM_ARB); - ShaderEnabled= true; - CurrentShader = 0; + ShaderEnabled= true; } if (CurrentShader != Shader) { - CurrentShader = Shader; + if(Shader != 0) + CurrentShader = Shader; glBindProgramARB(GL_VERTEX_PROGRAM_ARB, CurrentShader); } } \ No newline at end of file