X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fauxiliary%2Futil%2Fu_resource.h;h=6736476f4da9aa91a37a6915fb8791b815ba5e6a;hb=f0993f81c7fab4ceb99b010d8ee2facbf4fdc737;hp=977e0136bea30e86adfef7f340172308dd8f9ef5;hpb=a69efa9482d7d4dee476a50b3788544ba9b14a50;p=mesa.git diff --git a/src/gallium/auxiliary/util/u_resource.h b/src/gallium/auxiliary/util/u_resource.h index 977e0136bea..6736476f4da 100644 --- a/src/gallium/auxiliary/util/u_resource.h +++ b/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