summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm.c1
-rw-r--r--src/gallium/auxiliary/draw/draw_pt.c6
2 files changed, 7 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);
diff --git a/src/gallium/auxiliary/draw/draw_pt.c b/src/gallium/auxiliary/draw/draw_pt.c
index e0b8007a4f5..c4d06de84bb 100644
--- a/src/gallium/auxiliary/draw/draw_pt.c
+++ b/src/gallium/auxiliary/draw/draw_pt.c
@@ -533,6 +533,12 @@ draw_vbo(struct draw_context *draw,
for (instance = 0; instance < info->instance_count; instance++) {
draw->instance_id = instance + info->start_instance;
+ /* check for overflow */
+ if (draw->instance_id < instance ||
+ draw->instance_id < info->start_instance) {
+ /* if we overflown just set the instance id to the max */
+ draw->instance_id = 0xffffffff;
+ }
draw_new_instance(draw);