From bd8a5ae4d8d20199dd93aaec5fbcfa66a94b4d3c Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 4 Jan 2022 13:06:38 -0500 Subject: [PATCH] Revert "zink: when performing an implicit reset, sync qbos" this appeared to fix some sort of bug related to preserving qbo data, but really there shouldn't have been any sort of bug anyway since the qbos all get read back, and thus the data is already preserved instead, it just preserved the query id, which overloaded the pools and crashed This reverts commit 79790e276f61f23217badd80c51add755dfe18ac. fixes #5669 Reviewed-by: Hoe Hao Cheng Part-of: (cherry picked from commit 2fa1bf60d63ed5d08e296a6ecfc4122d4c3dcb71) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_query.c | 20 -------------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 7c67f8e8707..bc79c289c17 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -5197,7 +5197,7 @@ "description": "Revert \"zink: when performing an implicit reset, sync qbos\"", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "79790e276f61f23217badd80c51add755dfe18ac" }, diff --git a/src/gallium/drivers/zink/zink_query.c b/src/gallium/drivers/zink/zink_query.c index f06e94692a6..34c600b9f42 100644 --- a/src/gallium/drivers/zink/zink_query.c +++ b/src/gallium/drivers/zink/zink_query.c @@ -183,22 +183,6 @@ is_bool_query(struct zink_query *query) query->type == PIPE_QUERY_GPU_FINISHED; } -static void -qbo_sync_from_prev(struct zink_context *ctx, struct zink_query *query, unsigned id_offset, unsigned last_start) -{ - assert(id_offset); - - struct zink_query_buffer *prev = list_last_entry(&query->buffers, struct zink_query_buffer, list); - unsigned result_size = get_num_results(query->type) * sizeof(uint64_t); - /* this is get_buffer_offset() but without the zink_query object */ - unsigned qbo_offset = last_start * get_num_results(query->type) * sizeof(uint64_t); - query->curr_query = id_offset; - query->curr_qbo->num_results = id_offset; - zink_copy_buffer(ctx, zink_resource(query->curr_qbo->buffer), zink_resource(prev->buffer), 0, - qbo_offset, - id_offset * result_size); -} - static bool qbo_append(struct pipe_screen *screen, struct zink_query *query) { @@ -577,8 +561,6 @@ copy_results_to_buffer(struct zink_context *ctx, struct zink_query *query, struc static void reset_pool(struct zink_context *ctx, struct zink_batch *batch, struct zink_query *q) { - unsigned last_start = q->last_start; - unsigned id_offset = q->curr_query - q->last_start; /* This command must only be called outside of a render pass instance * * - vkCmdResetQueryPool spec @@ -607,8 +589,6 @@ reset_pool(struct zink_context *ctx, struct zink_batch *batch, struct zink_query reset_qbo(q); else debug_printf("zink: qbo alloc failed on reset!"); - if (id_offset) - qbo_sync_from_prev(ctx, q, id_offset, last_start); } static inline unsigned