From 049caf169657e47e56880f14f1d7c876a09ffec7 Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Sun, 8 Feb 2026 00:35:07 +0800 Subject: [PATCH] pvr: only specially handle gfx subcmd for BeginQuery Among all subcommands, only gfx subcommands are bound to a query pool, other subcommands seem to need no special handling. In addition, if a ResetQuery is done before BeginQuery, the last subcommand will be a event one, which fails the current assert that assumes it's a gfx one. Change the assertion of the subcommand being a gfx one to an addition check of whether the subcommand is a gfx one. This fixes crash of Vulkan CTS 1.4.5.1 test dEQP-VK.query_pool.discard.normal.no_depth.none.discard . Backport-to: 26.0 Signed-off-by: Icenowy Zheng Reviewed-by: Simon Perretta (cherry picked from commit 5a497316d4da5fe9217f8acc31b5098c1b896dba) Part-of: --- .pick_status.json | 2 +- src/imagination/vulkan/pvr_arch_cmd_query.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index e8a688801a6..c76e5e491fe 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -4924,7 +4924,7 @@ "description": "pvr: only specially handle gfx subcmd for BeginQuery", "nominated": true, "nomination_type": 4, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/imagination/vulkan/pvr_arch_cmd_query.c b/src/imagination/vulkan/pvr_arch_cmd_query.c index 334ea1014c9..36bc1fd3781 100644 --- a/src/imagination/vulkan/pvr_arch_cmd_query.c +++ b/src/imagination/vulkan/pvr_arch_cmd_query.c @@ -170,9 +170,8 @@ void PVR_PER_ARCH(CmdBeginQuery)(VkCommandBuffer commandBuffer, /* Occlusion queries can't be nested. */ assert(!state->vis_test_enabled); - if (state->current_sub_cmd) { - assert(state->current_sub_cmd->type == PVR_SUB_CMD_TYPE_GRAPHICS); - + if (state->current_sub_cmd && + state->current_sub_cmd->type == PVR_SUB_CMD_TYPE_GRAPHICS) { if (!state->current_sub_cmd->gfx.query_pool) { state->current_sub_cmd->gfx.query_pool = pool; } else if (state->current_sub_cmd->gfx.query_pool != pool) {