[PATCH 04/15] glamor: Drop a bunch of GLES2 ifdefs.
Michel Dänzer
michel at daenzer.net
Tue Feb 4 03:56:12 CET 2014
On Mon, 2014-02-03 at 11:03 -0800, Eric Anholt wrote:
> Now that we're using epoxy, we can write code using both desktop and
> ES symbols and decide what to use at runtime.
Nice.
> diff --git a/glamor/glamor_copyarea.c b/glamor/glamor_copyarea.c
> index 498a06e..8cc7cad 100644
> --- a/glamor/glamor_copyarea.c
> +++ b/glamor/glamor_copyarea.c
> @@ -170,10 +168,10 @@ glamor_copy_n_to_n_textured(DrawablePtr src,
>
> glActiveTexture(GL_TEXTURE0);
> glBindTexture(GL_TEXTURE_2D, src_pixmap_priv->base.fbo->tex);
> -#ifndef GLAMOR_GLES2
> - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
> - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
> -#endif
> + if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) {
> + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
> + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
> + }
Should this set GL_CLAMP_TO_EDGE for GLES2, as below?
> diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
> index ecc4606..cad0c53 100644
> --- a/glamor/glamor_render.c
> +++ b/glamor/glamor_render.c
> @@ -535,14 +535,16 @@ glamor_set_composite_texture(glamor_screen_private *glamor_priv, int unit,
> repeat_type = picture->repeatType;
> switch (picture->repeatType) {
> case RepeatNone:
> -#ifndef GLAMOR_GLES2
> - /* 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);
> -#endif
> + 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);
> + }
Looks like this test was reversed in the conversion.
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
More information about the xorg-devel
mailing list