[PATCH 04/15] glamor: Drop a bunch of GLES2 ifdefs.

Eric Anholt eric at anholt.net
Fri Feb 7 21:49:24 CET 2014


Michel Dänzer <michel at daenzer.net> writes:

> 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?

I dont want to do functional changes in the ifdef removal.
Additionally, I really don't care about GLES2 beyond not making it worse
myself -- since I work on open source drivers, there's no reason to use
crippled GL with them.

Given that it's copy_n_to_n, I suspect these clamp parameters don't
matter at all -- they should already be 1:1 and clipped.

>> 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.

Thanks!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20140207/ffaacc0b/attachment.pgp>


More information about the xorg-devel mailing list