xserver: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 25 17:29:29 UTC 2025


 glamor/glamor_composite_glyphs.c |   22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

New commits:
commit eba15f1ba75bc041d54693ebc62a8b9957b8b033
Author: Icenowy Zheng <uwu at icenowy.me>
Date:   Sat Dec 14 01:07:31 2024 +0800

    glamor: Fix dual blend on GLES3
    
    The EXT_blend_func_extended extension on ESSL always requires explicit
    request to allow two FS out variables because of limitations of the ESSL
    language, which is mentioned as the No.6 issue of the extension's
    specification.
    
    Fix this by adding the extension request.
    
    The original behavior on GLES3 is slightly against the specification of
    GL_EXT_blend_func_extended extension, however Mesa and older version of
    PowerVR closed drivers will just ignore this issue. Newest PowerVR
    closed driver will bail out on this problem, so it deems a fix now.
    
    Fixes: ee107cd4911e ("glamor: support GLES3 shaders")
    Signed-off-by: Icenowy Zheng <uwu at icenowy.me>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1750>

diff --git a/glamor/glamor_composite_glyphs.c b/glamor/glamor_composite_glyphs.c
index 428303091..13af727ff 100644
--- a/glamor/glamor_composite_glyphs.c
+++ b/glamor/glamor_composite_glyphs.c
@@ -178,6 +178,24 @@ glamor_glyph_add(struct glamor_glyph_atlas *atlas, DrawablePtr glyph_draw)
     return TRUE;
 }
 
+static const glamor_facet glamor_facet_composite_glyphs_es300 = {
+    .name = "composite_glyphs",
+    .version = 130,
+    .fs_extensions = ("#extension GL_EXT_blend_func_extended : enable\n"),
+    .vs_vars = ("in vec4 primitive;\n"
+                "in vec2 source;\n"
+                "out vec2 glyph_pos;\n"),
+    .vs_exec = ("       vec2 pos = primitive.zw * vec2(gl_VertexID&1, (gl_VertexID&2)>>1);\n"
+                GLAMOR_POS(gl_Position, (primitive.xy + pos))
+                "       glyph_pos = (source + pos) * ATLAS_DIM_INV;\n"),
+    .fs_vars = ("in vec2 glyph_pos;\n"
+                "out vec4 color0;\n"
+                "out vec4 color1;\n"),
+    .fs_exec = ("       vec4 mask = texture(atlas, glyph_pos);\n"),
+    .source_name = "source",
+    .locations = glamor_program_location_atlas,
+};
+
 static const glamor_facet glamor_facet_composite_glyphs_130 = {
     .name = "composite_glyphs",
     .version = 130,
@@ -454,7 +472,9 @@ glamor_composite_glyphs(CARD8 op,
                         if (glamor_glsl_has_ints(glamor_priv))
                             prog = glamor_setup_program_render(op, src, glyph_pict, dst,
                                                                glyphs_program,
-                                                               &glamor_facet_composite_glyphs_130,
+                                                               glamor_priv->is_gles ?
+                                                                   &glamor_facet_composite_glyphs_es300 :
+                                                                   &glamor_facet_composite_glyphs_130,
                                                                glamor_priv->glyph_defines);
                         else
                             prog = glamor_setup_program_render(op, src, glyph_pict, dst,


More information about the xorg-commit mailing list