From 6eea08ff99440aeb050f109dfdd150d46d719558 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 13 Jul 2023 12:30:29 +0200 Subject: [PATCH] vulkan: Don't merge too many drawing commands If a command takes too long to execute, Vulkan drivers will think they are inflooping and abort what they were doing. For the simple color shader with smallish nodes, this happens around 10M instances, as tested with the output of ./tests/rendernode-create-tests 10000000 colors.node So just limit it to way lower, so that we barely never hit it, ut still pick a big number so this optimization stays noticable. --- gsk/vulkan/gskvulkanop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gsk/vulkan/gskvulkanop.c b/gsk/vulkan/gskvulkanop.c index 130a61bfe6..7e9e8ee1ed 100644 --- a/gsk/vulkan/gskvulkanop.c +++ b/gsk/vulkan/gskvulkanop.c @@ -102,7 +102,7 @@ gsk_vulkan_op_draw_command_n (GskVulkanOp *op, gsize i; i = 1; - for (next = op->next; next; next = next->next) + for (next = op->next; next && i < 10 * 1000; next = next->next) { if (next->op_class != op->op_class || next->vertex_offset != op->vertex_offset + i * stride) -- 2.30.2