[gtk/wip/baedert/gl-rework: 16/16] gl renderer: Initialize alpha uniform to 1.0



commit b01c68fcb407e6e9891901f8ce6b26f9e16392e7
Author: Timm Bäder <mail baedert org>
Date:   Mon Dec 16 06:29:01 2019 +0100

    gl renderer: Initialize alpha uniform to 1.0
    
    This makes gl-legacy work and gl-gles work except for text and icons.

 gsk/gl/gskglrenderer.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index 5f3c8b5c10..739fce6a2f 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -2790,6 +2790,16 @@ gsk_gl_renderer_create_programs (GskGLRenderer  *self,
   INIT_PROGRAM_UNIFORM_LOCATION (repeat, child_bounds);
   INIT_PROGRAM_UNIFORM_LOCATION (repeat, texture_rect);
 
+
+  /* We initialize the alpha uniform here, since the default value is important.
+   * We can't do it in the shader like a resonable person would because that doesn't
+   * work in gles. */
+  for (i = 0; i < GL_N_PROGRAMS; i++)
+    {
+      glUseProgram(self->programs[i].id);
+      glUniform1f (self->programs[i].alpha_location, 1.0);
+    }
+
 out:
   gsk_gl_shader_builder_finish (&shader_builder);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]