diff options
author | Marek Olšák <[email protected]> | 2017-12-11 19:27:39 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-12-25 14:23:02 +0100 |
commit | 986e467e4c5c9610a01b0176c02c2310ed019ae8 (patch) | |
tree | c608a5876e4cb8b17319bfba760ebfb7cd622c16 /src/gallium/auxiliary/util/u_inlines.h | |
parent | 70b5e85fc3a79214b4f25db0e6d8fcc32d62a2f1 (diff) |
gallium/util: add util_num_layers helper
Diffstat (limited to 'src/gallium/auxiliary/util/u_inlines.h')
-rw-r--r-- | src/gallium/auxiliary/util/u_inlines.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h index 790352d7800..4ba6ad72b62 100644 --- a/src/gallium/auxiliary/util/u_inlines.h +++ b/src/gallium/auxiliary/util/u_inlines.h @@ -666,6 +666,12 @@ util_max_layer(const struct pipe_resource *r, unsigned level) } } +static inline unsigned +util_num_layers(const struct pipe_resource *r, unsigned level) +{ + return util_max_layer(r, level) + 1; +} + static inline bool util_texrange_covers_whole_level(const struct pipe_resource *tex, unsigned level, unsigned x, unsigned y, @@ -675,7 +681,7 @@ util_texrange_covers_whole_level(const struct pipe_resource *tex, return x == 0 && y == 0 && z == 0 && width == u_minify(tex->width0, level) && height == u_minify(tex->height0, level) && - depth == util_max_layer(tex, level) + 1; + depth == util_num_layers(tex, level); } #ifdef __cplusplus |