From: Benjamin Otte Date: Thu, 13 Jul 2023 10:30:29 +0000 (+0200) Subject: vulkan: Don't merge too many drawing commands X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~60^2~18 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=6eea08ff99440aeb050f109dfdd150d46d719558;p=gtk4.git 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. --- 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)