summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_box.h
diff options
context:
space:
mode:
authorPatrick Rudolph <[email protected]>2015-09-24 19:57:51 +0200
committerAxel Davy <[email protected]>2016-02-04 22:12:17 +0100
commit2a4d1509c8de5973871a69aa64b4f92d73351e0e (patch)
treec97fefaa907777bcd5273cfd364891cdcb3f02c5 /src/gallium/auxiliary/util/u_box.h
parent924038c08f03e8f55522951a6ae27d9fab42e3a1 (diff)
st/nine: Fix use of uninitialized memory
The values of box.z and box.depth weren't set and lead to a crash. Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util/u_box.h')
-rw-r--r--src/gallium/auxiliary/util/u_box.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_box.h b/src/gallium/auxiliary/util/u_box.h
index 66cf989a830..00f231dc683 100644
--- a/src/gallium/auxiliary/util/u_box.h
+++ b/src/gallium/auxiliary/util/u_box.h
@@ -195,4 +195,16 @@ u_box_minify_2d(struct pipe_box *dst,
dst->height = MAX2(src->height >> l, 1);
}
+static inline void
+u_box_minify_3d(struct pipe_box *dst,
+ const struct pipe_box *src, unsigned l)
+{
+ dst->x = src->x >> l;
+ dst->y = src->y >> l;
+ dst->z = src->z >> l;
+ dst->width = MAX2(src->width >> l, 1);
+ dst->height = MAX2(src->height >> l, 1);
+ dst->depth = MAX2(src->depth >> l, 1);
+}
+
#endif