summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo/ilo_resource.h
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2014-01-10 13:50:52 +0800
committerChia-I Wu <[email protected]>2014-01-14 15:19:41 +0800
commitaf57378e599c00711bf1109fb84e6032668ecaa4 (patch)
tree610328bf4be70f32915173daf71f5557cac4782d /src/gallium/drivers/ilo/ilo_resource.h
parent8f9b70fa3c41418bc2b28551642ea786ed0c2e79 (diff)
ilo: simplify ilo_texture_set_slice_flags()
Call ilo_texture_get_slice() for the last slice so that we can get rid of the duplicated assert().
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_resource.h')
-rw-r--r--src/gallium/drivers/ilo/ilo_resource.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/gallium/drivers/ilo/ilo_resource.h b/src/gallium/drivers/ilo/ilo_resource.h
index 124581ab665..afb49ff48b4 100644
--- a/src/gallium/drivers/ilo/ilo_resource.h
+++ b/src/gallium/drivers/ilo/ilo_resource.h
@@ -146,14 +146,12 @@ ilo_texture_set_slice_flags(struct ilo_texture *tex, unsigned level,
unsigned first_slice, unsigned num_slices,
unsigned mask, unsigned value)
{
+ const struct ilo_texture_slice *last =
+ ilo_texture_get_slice(tex, level, first_slice + num_slices - 1);
struct ilo_texture_slice *slice =
ilo_texture_get_slice(tex, level, first_slice);
- assert(first_slice + num_slices - 1 <
- ((tex->base.target == PIPE_TEXTURE_3D) ?
- u_minify(tex->base.depth0, level) : tex->base.array_size));
-
- while (num_slices--) {
+ while (slice <= last) {
slice->flags = (slice->flags & ~mask) | (value & mask);
slice++;
}