summaryrefslogtreecommitdiff
path: root/glamor/glamor_render.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2016-09-24 22:26:17 +0300
committerEric Anholt <eric@anholt.net>2016-09-29 09:10:53 -0700
commit117d614d1ba324bdb02c50a430c2e0d22a384f03 (patch)
tree88092f432c5801e7cca538d8be9212a6090b741e /glamor/glamor_render.c
parent7a5ddf8da5ed817aa2dd6f7af1b9197a5ceec60b (diff)
glamor: Require GL_OES_texture_border_clamp for GLES2.
The extension came out in 2000, and all Mesa-supported hardware that can do glamor supports it. We were already relying on the ARB version being present on desktop. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'glamor/glamor_render.c')
-rw-r--r--glamor/glamor_render.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index f5651eb87..9aca75061 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -533,16 +533,8 @@ glamor_set_composite_texture(glamor_screen_private *glamor_priv, int unit,
repeat_type = picture->repeatType;
switch (picture->repeatType) {
case RepeatNone:
- if (glamor_priv->gl_flavor != GLAMOR_GL_ES2) {
- /* XXX GLES2 doesn't support GL_CLAMP_TO_BORDER. */
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,
- GL_CLAMP_TO_BORDER);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T,
- GL_CLAMP_TO_BORDER);
- } else {
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- }
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
break;
case RepeatNormal:
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
@@ -573,12 +565,12 @@ glamor_set_composite_texture(glamor_screen_private *glamor_priv, int unit,
break;
}
- /*
- * GLES2 doesn't support RepeatNone. We need to fix it anyway.
- *
- **/
+ /* Handle RepeatNone in the shader when the source is missing the
+ * alpha channel, as GL will return an alpha for 1 if the texture
+ * is RGB (no alpha), which we use for 16bpp textures.
+ */
if (glamor_pixmap_priv_is_large(pixmap_priv) ||
- ((!PICT_FORMAT_A(picture->format) || glamor_priv->gl_flavor == GLAMOR_GL_ES2) &&
+ (!PICT_FORMAT_A(picture->format) &&
repeat_type == RepeatNone && picture->transform)) {
glamor_pixmap_fbo_fix_wh_ratio(wh, pixmap, pixmap_priv);
glUniform4fv(wh_location, 1, wh);