mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-21 07:40:38 +02:00
util/prim_restart: assert the index size at the start of the function
this lets it be removed from the macro loop Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10966>
This commit is contained in:
parent
c129ede523
commit
5d54b64e6d
1 changed files with 10 additions and 0 deletions
|
|
@ -241,6 +241,16 @@ util_draw_vbo_without_prim_restart(struct pipe_context *context,
|
|||
assert(info->index_size);
|
||||
assert(info->primitive_restart);
|
||||
|
||||
switch (info->index_size) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 4:
|
||||
break;
|
||||
default:
|
||||
assert(!"Bad index size");
|
||||
return PIPE_ERROR_BAD_INPUT;
|
||||
}
|
||||
|
||||
if (indirect_info && indirect_info->buffer) {
|
||||
indirect = read_indirect_elements(context, indirect_info);
|
||||
info_count = indirect.count;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue