Update r_opengl.c

This commit is contained in:
Jaime Passos 2019-06-10 16:53:03 -03:00
parent de5e44cfbc
commit e251f9c230

View file

@ -739,7 +739,9 @@ EXPORT void HWRAPI(LoadShaders) (void)
if (gl_customfragmentshaders[i]) if (gl_customfragmentshaders[i])
frag_shader = gl_customfragmentshaders[i]; frag_shader = gl_customfragmentshaders[i];
if (i >= MAXSHADERS || i >= MAXSHADERPROGRAMS) if (i >= MAXSHADERS)
break;
if (i >= MAXSHADERPROGRAMS)
break; break;
// //
@ -1590,10 +1592,8 @@ static void load_shaders(FSurfaceInfo *Surface, GLRGBAFloat *mix, GLRGBAFloat *f
if (gl_shaderprograms[gl_currentshaderprogram]) if (gl_shaderprograms[gl_currentshaderprogram])
{ {
pglUseProgram(gl_shaderprograms[gl_currentshaderprogram]); pglUseProgram(gl_shaderprograms[gl_currentshaderprogram]);
//
// set uniforms // set uniforms
// {
#define GETUNI(uniform) pglGetUniformLocation(gl_shaderprograms[gl_currentshaderprogram], uniform); #define GETUNI(uniform) pglGetUniformLocation(gl_shaderprograms[gl_currentshaderprogram], uniform);
GLint UNIFORM_fog_mode = GETUNI("fog_mode"); GLint UNIFORM_fog_mode = GETUNI("fog_mode");
GLint UNIFORM_fog_density = GETUNI("fog_density"); GLint UNIFORM_fog_density = GETUNI("fog_density");
@ -1639,6 +1639,7 @@ static void load_shaders(FSurfaceInfo *Surface, GLRGBAFloat *mix, GLRGBAFloat *f
#undef UNIFORM_3 #undef UNIFORM_3
#undef UNIFORM_4 #undef UNIFORM_4
} }
}
else else
pglUseProgram(0); pglUseProgram(0);
} }