st/mesa: don't crash when draw indirect buffer has no storage

Fixes: 22f6624ed3 - gallium: separate indirect stuff from pipe_draw_info

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13471>
(cherry picked from commit 520300ad22)
This commit is contained in:
Marek Olšák 2021-10-21 15:40:20 -04:00 committed by Dylan Baker
parent 6c8fca2406
commit af4a05f15c
2 changed files with 5 additions and 1 deletions

View file

@ -157,7 +157,7 @@
"description": "st/mesa: don't crash when draw indirect buffer has no storage",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "22f6624ed318e8131681ec1f2e7b3a59449df412"
},

View file

@ -264,6 +264,10 @@ st_indirect_draw_vbo(struct gl_context *ctx,
indirect.buffer = st_buffer_object(indirect_data)->buffer;
indirect.offset = indirect_offset;
/* Viewperf2020/Maya draws with a buffer that has no storage. */
if (!indirect.buffer)
return;
if (!st->has_multi_draw_indirect) {
int i;