aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/gallium/auxiliary/util/u_draw.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-12-05 09:16:39 +0100
committermarha <marha@users.sourceforge.net>2012-12-05 09:16:39 +0100
commit52fc95bab22331376f6a7351fdc07f805bd67610 (patch)
treed93c6fce43dab496004a97a4dfc8bb38e5da6f5a /mesalib/src/gallium/auxiliary/util/u_draw.c
parent6e1f3114a922dc8ac7c1ae0c20d64b8f7a0f5ef7 (diff)
parente82692e521240c5f8592f9ce56c9d5b3d68870ec (diff)
downloadvcxsrv-52fc95bab22331376f6a7351fdc07f805bd67610.tar.gz
vcxsrv-52fc95bab22331376f6a7351fdc07f805bd67610.tar.bz2
vcxsrv-52fc95bab22331376f6a7351fdc07f805bd67610.zip
Merge remote-tracking branch 'origin/released'
* origin/released: mesa git update 5 dec 2012
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_draw.c')
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_draw.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_draw.c b/mesalib/src/gallium/auxiliary/util/u_draw.c
index 5b3c41231..83d9284b8 100644
--- a/mesalib/src/gallium/auxiliary/util/u_draw.c
+++ b/mesalib/src/gallium/auxiliary/util/u_draw.c
@@ -108,8 +108,15 @@ util_draw_max_index(
else {
/* Per-instance data. Simply make sure the state tracker didn't
* request more instances than those that fit in the buffer */
- assert((info->start_instance + info->instance_count)/element->instance_divisor
- <= (buffer_max_index + 1));
+ if ((info->start_instance + info->instance_count)/element->instance_divisor
+ > (buffer_max_index + 1)) {
+ /* FIXME: We really should stop thinking in terms of maximum
+ * indices/instances and simply start clamping against buffer
+ * size. */
+ debug_printf("%s: too many instances for vertex buffer\n",
+ __FUNCTION__);
+ return 0;
+ }
}
}
}