summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2022-01-04 13:04:07 -0500
committerEric Engestrom <eric@engestrom.ch>2022-01-26 18:28:29 +0000
commit48174fea161676f9b2fe1712708c9f1477fb05f7 (patch)
tree4468c2b799ab60b919538f01fd5332f8fe475672
parentf36373e072d154450664f137f97e7a8d88b61005 (diff)
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 <haochengho12907@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14397> (cherry picked from commit b7a4faea9b4191e66aaa3bbf43c763aab5678ce3)
-rw-r--r--.pick_status.json2
-rw-r--r--src/gallium/drivers/zink/zink_query.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/.pick_status.json b/.pick_status.json
index f7019a48f9a..7c67f8e8707 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -5206,7 +5206,7 @@
"description": "zink: skip readback of qbos with no results",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": "93190be1b990d61df329ca0cbce9bd0fb31c7607"
},
diff --git a/src/gallium/drivers/zink/zink_query.c b/src/gallium/drivers/zink/zink_query.c
index dc28073d91e..f06e94692a6 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) {