summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2014-09-29 16:10:18 -0600
committerBrian Paul <[email protected]>2014-09-30 12:08:49 -0600
commit0fb1e6b7b41da22406d61d0a1fc7988384a45c8b (patch)
tree2f4a890b41e15826229d964b34358b46877192b7 /src/gallium/auxiliary
parent59562e9ba5330cb2033757a582fe7f449140af46 (diff)
util: simplify PIPE_TEXTURE_CUBE case in util_max_layer()
For cube resources, the array_size value should be 6. So handle that case as we do for array texture resources. But assert that array_size==6 just to be safe. Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/util/u_inlines.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h
index c80ec487ece..95401621ec3 100644
--- a/src/gallium/auxiliary/util/u_inlines.h
+++ b/src/gallium/auxiliary/util/u_inlines.h
@@ -627,10 +627,11 @@ static INLINE unsigned
util_max_layer(const struct pipe_resource *r, unsigned level)
{
switch (r->target) {
- case PIPE_TEXTURE_CUBE:
- return 6 - 1;
case PIPE_TEXTURE_3D:
return u_minify(r->depth0, level) - 1;
+ case PIPE_TEXTURE_CUBE:
+ assert(r->array_size == 6);
+ /* fall-through */
case PIPE_TEXTURE_1D_ARRAY:
case PIPE_TEXTURE_2D_ARRAY:
case PIPE_TEXTURE_CUBE_ARRAY: