little fx to solve issue 2897

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5839 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Rodolfo Osvaldo Bogado 2010-07-05 19:27:08 +00:00
parent f3901b6b43
commit 19cdaaae89
3 changed files with 7 additions and 9 deletions

View File

@ -315,7 +315,6 @@ bool PixelShaderCache::CompilePixelShader(FRAGMENTSHADER& ps, const char* pstrpr
//Disable Fragment programs and reset the selected Program //Disable Fragment programs and reset the selected Program
void PixelShaderCache::DisableShader() void PixelShaderCache::DisableShader()
{ {
CurrentShader = 0;
if(ShaderEnabled) if(ShaderEnabled)
{ {
glDisable(GL_FRAGMENT_PROGRAM_ARB); glDisable(GL_FRAGMENT_PROGRAM_ARB);
@ -331,10 +330,10 @@ void PixelShaderCache::SetCurrentShader(GLuint Shader)
{ {
glEnable(GL_FRAGMENT_PROGRAM_ARB); glEnable(GL_FRAGMENT_PROGRAM_ARB);
ShaderEnabled = true; ShaderEnabled = true;
CurrentShader = 0;
} }
if(CurrentShader != Shader) if(CurrentShader != Shader)
{ {
if(Shader != 0)
CurrentShader = Shader; CurrentShader = Shader;
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, CurrentShader); glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, CurrentShader);
} }

View File

@ -596,8 +596,8 @@ void Renderer::RestoreAPIState()
SetColorMask(); SetColorMask();
SetBlendMode(true); SetBlendMode(true);
VertexShaderCache::SetCurrentShader(1); VertexShaderCache::SetCurrentShader(0);
PixelShaderCache::SetCurrentShader(1); PixelShaderCache::SetCurrentShader(0);
} }
void Renderer::SetColorMask() void Renderer::SetColorMask()

View File

@ -238,7 +238,6 @@ bool VertexShaderCache::CompileVertexShader(VERTEXSHADER& vs, const char* pstrpr
void VertexShaderCache::DisableShader() void VertexShaderCache::DisableShader()
{ {
CurrentShader = 0;
if (ShaderEnabled) if (ShaderEnabled)
{ {
glDisable(GL_VERTEX_PROGRAM_ARB); glDisable(GL_VERTEX_PROGRAM_ARB);
@ -253,10 +252,10 @@ void VertexShaderCache::SetCurrentShader(GLuint Shader)
{ {
glEnable(GL_VERTEX_PROGRAM_ARB); glEnable(GL_VERTEX_PROGRAM_ARB);
ShaderEnabled= true; ShaderEnabled= true;
CurrentShader = 0;
} }
if (CurrentShader != Shader) if (CurrentShader != Shader)
{ {
if(Shader != 0)
CurrentShader = Shader; CurrentShader = Shader;
glBindProgramARB(GL_VERTEX_PROGRAM_ARB, CurrentShader); glBindProgramARB(GL_VERTEX_PROGRAM_ARB, CurrentShader);
} }