[Mesa-dev] [PATCH] mesa/texgetimage: fix missing stencil check
Marek Olšák
maraeo at gmail.com
Tue Aug 25 02:44:51 PDT 2015
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Marek
On Tue, Aug 25, 2015 at 3:11 AM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> GetTexImage can read to stencil8 but only from
> a stencil or depthstencil textures.
>
> This fixes a bunch of failures in CTS
> GL33-CTS.gtf32.GL3Tests.packed_pixels
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
> src/mesa/main/texgetimage.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
> index c0ccce3..56f5de1 100644
> --- a/src/mesa/main/texgetimage.c
> +++ b/src/mesa/main/texgetimage.c
> @@ -1213,6 +1213,13 @@ getteximage_error_check(struct gl_context *ctx,
> "%s(format=GL_STENCIL_INDEX)", caller);
> return true;
> }
> + else if (_mesa_is_stencil_format(format)
> + && !_mesa_is_depthstencil_format(baseFormat)
> + && !_mesa_is_stencil_format(baseFormat)) {
> + _mesa_error(ctx, GL_INVALID_OPERATION,
> + "%s(format mismatch)", caller);
> + return true;
> + }
> else if (_mesa_is_ycbcr_format(format)
> && !_mesa_is_ycbcr_format(baseFormat)) {
> _mesa_error(ctx, GL_INVALID_OPERATION,
> --
> 2.4.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list