summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_llvm.c
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2013-06-25 17:01:14 -0400
committerZack Rusin <[email protected]>2013-06-28 04:24:20 -0400
commit88de009cc1ab838cd87416dcbbaa4f5b30173c71 (patch)
tree6f07591ed07dc76c7a202d90252f280cb6b6ec66 /src/gallium/auxiliary/draw/draw_llvm.c
parent2f13f28120fdfe2f5a64e87b4ec19db94bf63713 (diff)
draw: check for integer overflows in instance computation
Integers could easily overflow is the starting instance was large enough. Instead of letting bogus counts through set the instance to max if it overflown and let our regular buffer overflow computation handle it. Signed-off-by: Zack Rusin <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_llvm.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c
index c1b4acd25a8..33cccfe99aa 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_llvm.c
@@ -768,6 +768,7 @@ generate_fetch(struct gallivm_state *gallivm,
lp_build_const_int32(
gallivm,
util_format_get_blocksize(velem->src_format)));
+ lp_build_printf(gallivm, " instance_id = %u\n", instance_id);
lp_build_printf(gallivm, " stride = %u\n", stride);
lp_build_printf(gallivm, " buffer size = %u\n", buffer_size);
lp_build_printf(gallivm, " needed_buffer_size = %u\n", needed_buffer_size);