mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-10 16:50:13 +01:00
util/u_draw: Skip rendering instead of aborting when excessive number of instances is found.
This is a temporary hack. I believe the only way of properly fixing this is to check buffer overflow just before fetching based on addresses, instead of number of vertices/instances. This change simply allows tests that stress buffer overflows to complete without asserting, and should not affect valid rendering. Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
7da3a947c7
commit
4da0cb83ab
1 changed files with 9 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue