st/mesa: don't draw if the bound element array buffer is not allocated

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
This commit is contained in:
Marek Olšák 2018-03-19 16:51:21 -04:00
parent 31881079af
commit f754217517
1 changed files with 7 additions and 0 deletions

View File

@ -177,6 +177,13 @@ st_draw_vbo(struct gl_context *ctx,
/* indices are in a real VBO */
info.has_user_indices = false;
info.index.resource = st_buffer_object(bufobj)->buffer;
/* Return if the bound element array buffer doesn't have any backing
* storage. (nothing to do)
*/
if (!info.index.resource)
return;
start = pointer_to_offset(ib->ptr) / info.index_size;
} else {
/* indices are in user space memory */