diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-03-13 22:27:04 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-03-13 22:27:04 +0000 |
commit | 346b29ad8fb8a4c6ff1e12b0cd67ed8ce9ba6a6f (patch) | |
tree | 15712e1055b7b29eecb6808f70891ab51b3fb2e1 | |
parent | d2258fb31640eb9a9784ada204bd45efdf0b8e11 (diff) | |
parent | 064947356ab85f9255316dccc4217eb0e507e768 (diff) | |
download | gtk+-346b29ad8fb8a4c6ff1e12b0cd67ed8ce9ba6a6f.tar.gz |
Merge branch 'gles-coloring' into 'master'
ngl: Fix the coloring shader on GLESĀ 2.0
See merge request GNOME/gtk!3294
-rw-r--r-- | gsk/ngl/resources/coloring.glsl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gsk/ngl/resources/coloring.glsl b/gsk/ngl/resources/coloring.glsl index 69b21c6e2e..5b5d46a732 100644 --- a/gsk/ngl/resources/coloring.glsl +++ b/gsk/ngl/resources/coloring.glsl @@ -2,7 +2,7 @@ // coloring.glsl _OUT_ vec4 final_color; -flat _OUT_ int use_color; +_OUT_ float use_color; void main() { gl_Position = u_projection * u_modelview * vec4(aPosition, 0.0, 1.0); @@ -13,9 +13,9 @@ void main() { // and color glpyhs (used as source). The renderer sets // aColor to vec4(-1) for color glyhs. if (distance(aColor, vec4(-1)) < 0.001) - use_color = 0; + use_color = 0.0; else - use_color = 1; + use_color = 1.0; final_color = gsk_premultiply(aColor) * u_alpha; } @@ -24,12 +24,12 @@ void main() { // coloring.glsl _IN_ vec4 final_color; -flat _IN_ int use_color; +_IN_ float use_color; void main() { vec4 diffuse = GskTexture(u_source, vUv); - if (use_color == 1) + if (use_color > 0.0) gskSetOutputColor(final_color * diffuse.a); else gskSetOutputColor(diffuse * u_alpha); |