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.
This commit is contained in:
+9
-6
@@ -699,15 +699,18 @@ weston_surface_draw(struct weston_surface *es, struct weston_output *output)
|
|||||||
|
|
||||||
if (ec->current_shader != es->shader) {
|
if (ec->current_shader != es->shader) {
|
||||||
glUseProgram(es->shader->program);
|
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;
|
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) {
|
if (es->shader->alpha_uniform && es->alpha != ec->current_alpha) {
|
||||||
glUniform1f(es->shader->alpha_uniform, es->alpha / 255.0);
|
glUniform1f(es->shader->alpha_uniform, es->alpha / 255.0);
|
||||||
ec->current_alpha = es->alpha;
|
ec->current_alpha = es->alpha;
|
||||||
|
|||||||
Reference in New Issue
Block a user