compositor: Don't just update uniforms when we change shaders

The uniforms change from surface to surface or output to output, so always
set them.
dev
Kristian Høgsberg 13 years ago
parent 2ad3b7f866
commit 0452abc820
  1. 15
      src/compositor.c

@ -699,15 +699,18 @@ weston_surface_draw(struct weston_surface *es, struct weston_output *output)
if (ec->current_shader != es->shader) {
glUseProgram(es->shader->program);
glUniformMatrix4fv(es->shader->proj_uniform,
1, GL_FALSE, output->matrix.d);
if (es->shader->tex_uniform != GL_NONE)
glUniform1i(es->shader->tex_uniform, 0);
if (es->shader->color_uniform != GL_NONE)
glUniform4fv(es->shader->color_uniform,1, es->color);
ec->current_shader = es->shader;
}
glUniformMatrix4fv(es->shader->proj_uniform,
1, GL_FALSE, output->matrix.d);
if (es->shader->tex_uniform != GL_NONE)
glUniform1i(es->shader->tex_uniform, 0);
if (es->shader->color_uniform != GL_NONE)
glUniform4fv(es->shader->color_uniform,1, es->color);
if (es->shader->alpha_uniform && es->alpha != ec->current_alpha) {
glUniform1f(es->shader->alpha_uniform, es->alpha / 255.0);
ec->current_alpha = es->alpha;

Loading…
Cancel
Save