vulkan: Don't merge too many drawing commands
authorBenjamin Otte <otte@redhat.com>
Thu, 13 Jul 2023 10:30:29 +0000 (12:30 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 16 Jul 2023 11:16:43 +0000 (13:16 +0200)
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

index 130a61bfe63f03230f52510ceab957ba78bab0f6..7e9e8ee1ed6f6ab3a9aceb3822181b53bcbe6a66 100644 (file)
@@ -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)