[Mesa-dev] [PATCH 2/2] util: sipmlify PIPE_TEXTURE_CUBE case in util_max_layer()

Ilia Mirkin imirkin at alum.mit.edu
Mon Sep 29 15:18:28 PDT 2014


Subject typo: simplify

Otherwise this patch is Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

(Don't know llvmpipe, so can't say much about 1/2.)

On Mon, Sep 29, 2014 at 6:16 PM, Brian Paul <brianp at vmware.com> wrote:
> For cube resources, the array_size value should be 6.  So handle
> that case as we do for array texture resources.  But assert that
> array_size==6 just to be safe.
> ---
>  src/gallium/auxiliary/util/u_inlines.h |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h
> index c80ec48..9540162 100644
> --- a/src/gallium/auxiliary/util/u_inlines.h
> +++ b/src/gallium/auxiliary/util/u_inlines.h
> @@ -627,10 +627,11 @@ static INLINE unsigned
>  util_max_layer(const struct pipe_resource *r, unsigned level)
>  {
>     switch (r->target) {
> -   case PIPE_TEXTURE_CUBE:
> -      return 6 - 1;
>     case PIPE_TEXTURE_3D:
>        return u_minify(r->depth0, level) - 1;
> +   case PIPE_TEXTURE_CUBE:
> +      assert(r->array_size == 6);
> +      /* fall-through */
>     case PIPE_TEXTURE_1D_ARRAY:
>     case PIPE_TEXTURE_2D_ARRAY:
>     case PIPE_TEXTURE_CUBE_ARRAY:
> --
> 1.7.10.4
>
> _______________________________________________
> 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