Lucas Stach <l.st...@pengutronix.de> writes:

> From: Philipp Zabel <p.za...@pengutronix.de>
>
> Images with multiple planes in separate chained texture resources should
> report the correct number of planes.
>
> Signed-off-by: Philipp Zabel <p.za...@pengutronix.de>
> ---
>  src/gallium/state_trackers/dri/dri2.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/state_trackers/dri/dri2.c 
> b/src/gallium/state_trackers/dri/dri2.c
> index 510b7f8d04a7..4c8ea485cc70 100644
> --- a/src/gallium/state_trackers/dri/dri2.c
> +++ b/src/gallium/state_trackers/dri/dri2.c
> @@ -1083,7 +1083,9 @@ static GLboolean
>  dri2_query_image(__DRIimage *image, int attrib, int *value)
>  {
>     struct winsys_handle whandle;
> +   struct pipe_resource *tex;
>     unsigned usage;
> +   int i;
>  
>     if (image->use & __DRI_IMAGE_USE_BACKBUFFER)
>        usage = PIPE_HANDLE_USAGE_EXPLICIT_FLUSH;
> @@ -1157,7 +1159,9 @@ dri2_query_image(__DRIimage *image, int attrib, int 
> *value)
>        }
>        return GL_TRUE;
>     case __DRI_IMAGE_ATTRIB_NUM_PLANES:
> -      *value = 1;
> +      for (i = 0, tex = image->texture; i < 4 && tex; tex = tex->next)
> +         i++;
> +      *value = i;
>        return GL_TRUE;

What's the "< 4" limit for?  Other than that, patch 1-2 are:

Reviewed-by: Eric Anholt <e...@anholt.net>

Attachment: signature.asc
Description: PGP signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to