summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-05-09 13:36:39 +0200
committerMarek Olšák <[email protected]>2016-06-01 17:35:30 +0200
commit9d881cc0ac8f08f839dd86f6aeaf6c7bca97ccb1 (patch)
treef6cc4b3e1a7735fabca4c4d0c352744ff81fbe36 /src/gallium/auxiliary/util
parentca135a26126edfbcbf19feb6cf6c00eaba3372b9 (diff)
gallium/util: add util_texrange_covers_whole_level from radeon
Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r--src/gallium/auxiliary/util/u_inlines.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h
index a38223ca33c..90821b29de2 100644
--- a/src/gallium/auxiliary/util/u_inlines.h
+++ b/src/gallium/auxiliary/util/u_inlines.h
@@ -650,6 +650,18 @@ util_max_layer(const struct pipe_resource *r, unsigned level)
}
}
+static inline bool
+util_texrange_covers_whole_level(const struct pipe_resource *tex,
+ unsigned level, unsigned x, unsigned y,
+ unsigned z, unsigned width,
+ unsigned height, unsigned depth)
+{
+ 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;
+}
+
#ifdef __cplusplus
}
#endif