From b7a4faea9b4191e66aaa3bbf43c763aab5678ce3 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 4 Jan 2022 13:04:07 -0500 Subject: [PATCH] zink: skip readback of qbos with no results this is a no-op and also crashes Fixes: 93190be1b99 ("zink: rewrite query internals") Reviewed-by: Hoe Hao Cheng Part-of: --- src/gallium/drivers/zink/zink_query.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/drivers/zink/zink_query.c b/src/gallium/drivers/zink/zink_query.c index 894b68a20f9..9809c253d79 100644 --- a/src/gallium/drivers/zink/zink_query.c +++ b/src/gallium/drivers/zink/zink_query.c @@ -459,6 +459,8 @@ get_query_result(struct pipe_context *pctx, uint64_t *xfb_results = NULL; uint64_t *results; bool is_timestamp = query->type == PIPE_QUERY_TIMESTAMP || query->type == PIPE_QUERY_TIMESTAMP_DISJOINT; + if (!qbo->num_results) + continue; results = pipe_buffer_map_range(pctx, qbo->buffer, 0, (is_timestamp ? 1 : qbo->num_results) * result_size, flags, &xfer); if (!results) {