[Mesa-dev] [PATCH] teximage: ensure that Tex*SubImage* checks format

Marek Olšák maraeo at gmail.com
Wed Sep 4 04:10:55 UTC 2019


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Mon, Sep 2, 2019 at 7:40 PM Ilia Mirkin <imirkin at alum.mit.edu> wrote:

> We were previously not doing at least some of the checks. This uses the
> same logic that is used in glTexImage*.
>
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
>
> This seems to leave the Intel CI happy -
>
>
> https://mesa-ci.01.org/imirkin/builds/32/group/63a9f0ea7bb98050796b649e85481845
>
> And fixes things for the teximage-errors updates I sent in for piglit.
>
>  src/mesa/main/teximage.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> index f90765f40fa..e55e435779f 100644
> --- a/src/mesa/main/teximage.c
> +++ b/src/mesa/main/teximage.c
> @@ -2205,6 +2205,15 @@ texsubimage_error_check(struct gl_context *ctx,
> GLuint dimensions,
>        return GL_TRUE;
>     }
>
> +   if (!texture_formats_agree(texImage->InternalFormat, format)) {
> +      _mesa_error(ctx, GL_INVALID_OPERATION,
> +                  "%s(incompatible internalFormat = %s, format = %s)",
> +                  callerName,
> +                  _mesa_enum_to_string(texImage->InternalFormat),
> +                  _mesa_enum_to_string(format));
> +      return GL_TRUE;
> +   }
> +
>     GLenum internalFormat = _mesa_is_gles(ctx) ?
>        oes_float_internal_format(ctx, texImage->InternalFormat, type) :
>        texImage->InternalFormat;
> --
> 2.21.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190904/2b5b54b0/attachment.html>


More information about the mesa-dev mailing list