aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/gallium/auxiliary/util/u_resource.h
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_resource.h')
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_resource.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_resource.h b/mesalib/src/gallium/auxiliary/util/u_resource.h
index 977e0136b..a5e091fd6 100644
--- a/mesalib/src/gallium/auxiliary/util/u_resource.h
+++ b/mesalib/src/gallium/auxiliary/util/u_resource.h
@@ -26,9 +26,27 @@
#ifndef U_RESOURCE_H
#define U_RESOURCE_H
-struct pipe_resource;
+#include "pipe/p_state.h"
unsigned
util_resource_size(const struct pipe_resource *res);
+/**
+ * Return true if the resource is an array texture.
+ *
+ * Note that this function returns true for single-layered array textures.
+ */
+static INLINE boolean
+util_resource_is_array_texture(const struct pipe_resource *res)
+{
+ switch (res->target) {
+ case PIPE_TEXTURE_1D_ARRAY:
+ case PIPE_TEXTURE_2D_ARRAY:
+ case PIPE_TEXTURE_CUBE_ARRAY:
+ return TRUE;
+ default:
+ return FALSE;
+ }
+}
+
#endif