diff -r 4f32c7755138 -r f72b80448413 src/shader.c --- a/src/shader.c Fri Jul 25 18:50:36 2025 +0200 +++ b/src/shader.c Fri Jul 25 18:54:51 2025 +0200 @@ -225,10 +225,12 @@ if (asc_shader_invalid(shader)) { asc_active_glctx->active_program = 0; glUseProgram(0); + return -1; + } + if (asc_active_glctx->active_program == shader->gl_id) { + // already using this shader - continue return 0; } - if (asc_active_glctx->active_program == shader->gl_id) return 0; - if (asc_shader_invalid(shader)) return -1; asc_active_glctx->active_program = shader->gl_id; glUseProgram(shader->gl_id); glUniformMatrix4fv(shader->projection, 1, GL_FALSE, camera->projection);