[Mesa-dev] [Mesa-stable] [PATCH 13/15] mesa: Add gles3 error condition for GL_RGBA10_A2 buffer format in glCopyTexImage*()

Anuj Phogat anuj.phogat at gmail.com
Wed Jun 11 11:01:21 PDT 2014


Adding mesa-dev in CC.


On Wed, Jun 11, 2014 at 10:39 AM, Courtney Goeltzenleuchter <
courtney at lunarg.com> wrote:

>
>
>
> On Fri, Jun 6, 2014 at 5:57 PM, Anuj Phogat <anuj.phogat at gmail.com> wrote:
>
>> Fixes many failures in gles3 Khronos CTS test: packed_pixels
>>
>> Khronos bug# 9807
>> Cc: <mesa-stable at lists.freedesktop.org>
>> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
>>
>> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
>> ---
>>  src/mesa/main/teximage.c | 45
>> ++++++++++++++++++++++++++++-----------------
>>  1 file changed, 28 insertions(+), 17 deletions(-)
>>
>> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
>> index c926a2f..11b8439 100644
>> --- a/src/mesa/main/teximage.c
>> +++ b/src/mesa/main/teximage.c
>> @@ -3647,24 +3647,35 @@ copyteximage(struct gl_context *ctx, GLuint dims,
>>
>>     rb = _mesa_get_read_renderbuffer_for_format(ctx, internalFormat);
>>
>> -   /* From Page 139 of OpenGL ES 3.0 spec:
>> -    *    "If internalformat is sized, the internal format of the new
>> texel
>> -    *    array is internalformat, and this is also the new texel array’s
>> -    *    effective internal format. If the component sizes of
>> internalformat
>> -    *    do not exactly match the corresponding component sizes of the
>> source
>> -    *    buffer’s effective internal format, described below, an
>> -    *    INVALID_OPERATION error is generated. If internalformat is
>> unsized,
>> -    *    the internal format of the new texel array is the effective
>> internal
>> -    *    format of the source buffer, and this is also the new texel
>> array’s
>> -    *    effective internal format.
>> +   /* Conversion from GL_RGB10_A2 source buffer format is not allowed in
>> +    * OpenGL ES 3.0. Khronos bug# 9807.
>>      */
>> -   if (_mesa_is_gles3(ctx)
>> -       && !_mesa_is_enum_format_unsized(internalFormat)
>> -       && formats_differ_in_component_sizes (texFormat, rb->Format)) {
>> -      _mesa_error(ctx, GL_INVALID_OPERATION,
>> -                  "glCopyTexImage%uD(componenet size changed in"
>> -                  " internal format)", dims);
>> -      return;
>> +   if (_mesa_is_gles3(ctx)) {
>> +      if (_mesa_is_enum_format_unsized(internalFormat)) {
>>
>
> Should this helper function include gles in it's name since it's only
> checking for valid GLES internal formats?
>
Validity of internal format for gles and desktop is anyway checked
separately. So, I think we can safely use _mesa_is_enum_format_unsized() as
a common function for both gles and desktop.


>  +         if (rb->InternalFormat == GL_RGB10_A2) {
>> +               _mesa_error(ctx, GL_INVALID_OPERATION,
>> +                           "glCopyTexImage%uD(Reading from GL_RGB10_A2
>> buffer and"
>> +                           " writing to unsized internal format)", dims);
>> +               return;
>> +         }
>> +      }
>> +      /* From Page 139 of OpenGL ES 3.0 spec:
>> +       *    "If internalformat is sized, the internal format of the new
>> texel
>> +       *    array is internalformat, and this is also the new texel
>> array’s
>> +       *    effective internal format. If the component sizes of
>> internalformat
>> +       *    do not exactly match the corresponding component sizes of
>> the source
>> +       *    buffer’s effective internal format, described below, an
>> +       *    INVALID_OPERATION error is generated. If internalformat is
>> unsized,
>> +       *    the internal format of the new texel array is the effective
>> internal
>> +       *    format of the source buffer, and this is also the new texel
>> array’s
>> +       *    effective internal format.
>> +       */
>> +      else if (formats_differ_in_component_sizes (texFormat,
>> rb->Format)) {
>> +            _mesa_error(ctx, GL_INVALID_OPERATION,
>> +                        "glCopyTexImage%uD(componenet size changed in"
>> +                        " internal format)", dims);
>> +            return;
>> +      }
>>     }
>>
>>     assert(texFormat != MESA_FORMAT_NONE);
>> --
>> 1.8.3.1
>>
>> _______________________________________________
>> mesa-stable mailing list
>> mesa-stable at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-stable
>>
>
>
>
> --
> Courtney Goeltzenleuchter
> LunarG
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140611/02ff8d88/attachment-0001.html>


More information about the mesa-dev mailing list