[Mesa-dev] [PATCH 15/15] mesa: Add gles3 condition for normalized internal formats in glCopyTexImage*()

Jason Ekstrand jason at jlekstrand.net
Tue Jul 29 17:03:43 PDT 2014


Looks good to me.

Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>


On Fri, Jun 6, 2014 at 4:57 PM, Anuj Phogat <anuj.phogat at gmail.com> wrote:

> Fixes many failures in gles3 Khronos CTS test: packed_pixels
>
> Cc: <mesa-stable at lists.freedesktop.org>
> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
> ---
>  src/mesa/main/teximage.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>
> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> index 11b8439..a09d994 100644
> --- a/src/mesa/main/teximage.c
> +++ b/src/mesa/main/teximage.c
> @@ -2696,6 +2696,8 @@ copytexture_error_check( struct gl_context *ctx,
> GLuint dimensions,
>     if (_mesa_is_color_format(internalFormat)) {
>        bool is_int = _mesa_is_enum_format_integer(internalFormat);
>        bool is_rbint = _mesa_is_enum_format_integer(rb_internal_format);
> +      bool is_unorm = _mesa_is_enum_format_unorm(internalFormat);
> +      bool is_rbunorm = _mesa_is_enum_format_unorm(rb_internal_format);
>        if (is_int || is_rbint) {
>           if (is_int != is_rbint) {
>              _mesa_error(ctx, GL_INVALID_OPERATION,
> @@ -2709,6 +2711,19 @@ copytexture_error_check( struct gl_context *ctx,
> GLuint dimensions,
>              return GL_TRUE;
>           }
>        }
> +
> +      /* From page 138 of OpenGL ES 3.0 spec:
> +       *    "The error INVALID_OPERATION is generated if floating-point
> RGBA
> +       *    data is required; if signed integer RGBA data is required and
> the
> +       *    format of the current color buffer is not signed integer; if
> +       *    unsigned integer RGBA data is required and the format of the
> +       *    current color buffer is not unsigned integer; or if
> fixed-point
> +       *    RGBA data is required and the format of the current color
> buffer
> +       *    is not fixed-point.
> +       */
> +      if (_mesa_is_gles(ctx) && is_unorm != is_rbunorm)
> +            _mesa_error(ctx, GL_INVALID_OPERATION,
> +                        "glCopyTexImage%dD(unorm vs non-unorm)",
> dimensions);
>     }
>
>     if (_mesa_is_compressed_format(ctx, internalFormat)) {
> --
> 1.8.3.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140729/1025e8f9/attachment.html>


More information about the mesa-dev mailing list