Revert "Only call glUniformMatrix4fv if needed"

This commit is contained in:
Twinaphex 2016-09-27 02:59:58 +02:00 committed by GitHub
parent 7d64fdabf9
commit 7672288fcd

View File

@ -1256,7 +1256,6 @@ static void gl_glsl_set_params(void *data, void *shader_data,
static bool gl_glsl_set_mvp(void *data, void *shader_data, const math_matrix_4x4 *mat)
{
static float current_mat_data[GFX_MAX_SHADERS];
int loc;
glsl_shader_data_t *glsl = (glsl_shader_data_t*)shader_data;
@ -1266,12 +1265,9 @@ static bool gl_glsl_set_mvp(void *data, void *shader_data, const math_matrix_4x4
goto fallback;
loc = glsl->uniforms[glsl->active_idx].mvp;
if (loc >= 0) {
if (*mat->data != current_mat_data[loc]) {
glUniformMatrix4fv(loc, 1, GL_FALSE, mat->data);
current_mat_data[loc] = *mat->data;
}
}
if (loc >= 0)
glUniformMatrix4fv(loc, 1, GL_FALSE, mat->data);
return true;
fallback: