1848b8605Smrg/*
2848b8605Smrg * Copyright 2013 VMware, Inc.
3848b8605Smrg * All Rights Reserved.
4848b8605Smrg *
5848b8605Smrg * Permission is hereby granted, free of charge, to any person obtaining a
6848b8605Smrg * copy of this software and associated documentation files (the
7848b8605Smrg * "Software"), to deal in the Software without restriction, including
8848b8605Smrg * without limitation the rights to use, copy, modify, merge, publish,
9848b8605Smrg * distribute, sub license, and/or sell copies of the Software, and to
10848b8605Smrg * permit persons to whom the Software is furnished to do so, subject to
11848b8605Smrg * the following conditions:
12848b8605Smrg *
13848b8605Smrg * The above copyright notice and this permission notice (including the
14848b8605Smrg * next paragraph) shall be included in all copies or substantial portions
15848b8605Smrg * of the Software.
16848b8605Smrg *
17848b8605Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18848b8605Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19848b8605Smrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
20848b8605Smrg * IN NO EVENT SHALL THE AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR
21848b8605Smrg * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22848b8605Smrg * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23848b8605Smrg * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24848b8605Smrg */
25848b8605Smrg
26848b8605Smrg#ifndef U_RESOURCE_H
27848b8605Smrg#define U_RESOURCE_H
28848b8605Smrg
29848b8605Smrg#include "pipe/p_state.h"
30848b8605Smrg
31848b8605Smrgunsigned
32848b8605Smrgutil_resource_size(const struct pipe_resource *res);
33848b8605Smrg
34848b8605Smrg/**
35b8e80941Smrg * Return true if the texture target is an array type.
36848b8605Smrg *
37848b8605Smrg * Note that this function returns true for single-layered array textures.
38848b8605Smrg */
39b8e80941Smrgstatic inline boolean
40b8e80941Smrgutil_texture_is_array(enum pipe_texture_target target)
41848b8605Smrg{
42b8e80941Smrg   switch (target) {
43848b8605Smrg   case PIPE_TEXTURE_1D_ARRAY:
44848b8605Smrg   case PIPE_TEXTURE_2D_ARRAY:
45848b8605Smrg   case PIPE_TEXTURE_CUBE_ARRAY:
46848b8605Smrg      return TRUE;
47848b8605Smrg   default:
48848b8605Smrg      return FALSE;
49848b8605Smrg   }
50848b8605Smrg}
51848b8605Smrg
52848b8605Smrg#endif
53