radeonsi: fix a crash when failing to create a context

When shader_query_buffers is NULL, the code treated as as non-empty.

Fixes: 792a638b03 "radeonsi/gfx10: implement streamout-related queries"

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16466>
(cherry picked from commit 6515b3b2dc)
This commit is contained in:
Marek Olšák 2022-05-11 18:22:46 -04:00 committed by Dylan Baker
parent 3642934612
commit d6009c3fe9
2 changed files with 4 additions and 1 deletions

View file

@ -94,7 +94,7 @@
"description": "radeonsi: fix a crash when failing to create a context",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "792a638b032d16fbe6404f9d90c34b3e0f1fb0b5"
},

View file

@ -446,6 +446,9 @@ void gfx10_init_query(struct si_context *sctx)
void gfx10_destroy_query(struct si_context *sctx)
{
if (!sctx->shader_query_buffers.next)
return;
while (!list_is_empty(&sctx->shader_query_buffers)) {
struct gfx10_sh_query_buffer *qbuf =
list_first_entry(&sctx->shader_query_buffers, struct gfx10_sh_query_buffer, list);