From 9ad2e4881992e77c9b5818fb60e03756bb814db2 Mon Sep 17 00:00:00 2001 From: Nick Hamilton Date: Wed, 11 Feb 2026 08:51:17 +0000 Subject: [PATCH] pvr: Fix incorrect subpass merging optimisation The subpass merging optimisation check for when subpasses are using tile buffers was in the incorrect location. The current check is in a function called from two places but only the first of these should have been doing the optimisation check. This was incorrectly affecting the number of renders that subpass merging could avoid. Partial fix for: dEQP-VK.renderpass.*.attachment_allocation.input_output.71 Fixes: 10b6a0d567e9 ("pvr: Add support for generating render pass hw setup data.") Signed-off-by: Nick Hamilton Reviewed-by: Frank Binns (cherry picked from commit 0640ac7e3bdf632eee4e4aa47da5445e5deb4af4) Part-of: --- .pick_status.json | 2 +- src/imagination/vulkan/pvr_arch_hw_pass.c | 17 +++++++---------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index db366f2b2fe..87d8845fe72 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -534,7 +534,7 @@ "description": "pvr: Fix incorrect subpass merging optimisation", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "10b6a0d567e9782ae5217f4303bdc6fd2f0610ec", "notes": null diff --git a/src/imagination/vulkan/pvr_arch_hw_pass.c b/src/imagination/vulkan/pvr_arch_hw_pass.c index 6e2b3e5816b..583aaf5340f 100644 --- a/src/imagination/vulkan/pvr_arch_hw_pass.c +++ b/src/imagination/vulkan/pvr_arch_hw_pass.c @@ -1759,16 +1759,6 @@ pvr_is_subpass_space_available(const struct pvr_device_info *dev_info, &sp_dsts->color[i]); if (result != VK_SUCCESS) goto err_free_alloc; - - /* Avoid merging subpasses which result in tile buffers having to be - * used. The benefit of merging must be weighed against the cost of - * writing/reading to tile buffers. - */ - if (ctx->hw_render && - sp_dsts->color[i].type != USC_MRT_RESOURCE_TYPE_OUTPUT_REG) { - result = vk_error(NULL, VK_ERROR_TOO_MANY_OBJECTS); - goto err_free_alloc; - } } else { sp_dsts->color[i].type = USC_MRT_RESOURCE_TYPE_INVALID; } @@ -1915,6 +1905,13 @@ pvr_can_combine_with_render(const struct pvr_device_info *dev_info, if (result != VK_SUCCESS) return false; + /* Avoid merging subpasses which result in tile buffers having to be + * used. The benefit of merging must be weighed against the cost of + * writing/reading to tile buffers. + */ + if (ctx->hw_render && new_alloc->tile_buffers_count > 0) + return false; + return true; }