mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 16:20:03 +01:00
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:ee107cd491("glamor: support GLES3 shaders") Signed-off-by: Icenowy Zheng <uwu@icenowy.me> (cherry picked from commiteba15f1ba7) Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2041>
This commit is contained in:
parent
69e440a282
commit
810fa68549
1 changed files with 21 additions and 1 deletions
|
|
@ -178,6 +178,24 @@ glamor_glyph_add(struct glamor_glyph_atlas *atlas, DrawablePtr glyph_draw)
|
||||||
return TRUE;
|
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 = {
|
static const glamor_facet glamor_facet_composite_glyphs_130 = {
|
||||||
.name = "composite_glyphs",
|
.name = "composite_glyphs",
|
||||||
.version = 130,
|
.version = 130,
|
||||||
|
|
@ -454,6 +472,8 @@ glamor_composite_glyphs(CARD8 op,
|
||||||
if (glamor_glsl_has_ints(glamor_priv))
|
if (glamor_glsl_has_ints(glamor_priv))
|
||||||
prog = glamor_setup_program_render(op, src, glyph_pict, dst,
|
prog = glamor_setup_program_render(op, src, glyph_pict, dst,
|
||||||
glyphs_program,
|
glyphs_program,
|
||||||
|
glamor_priv->is_gles ?
|
||||||
|
&glamor_facet_composite_glyphs_es300 :
|
||||||
&glamor_facet_composite_glyphs_130,
|
&glamor_facet_composite_glyphs_130,
|
||||||
glamor_priv->glyph_defines);
|
glamor_priv->glyph_defines);
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue