vulkan: Don't try that hard to use clear
authorBenjamin Otte <otte@redhat.com>
Wed, 12 Jul 2023 09:38:32 +0000 (11:38 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 16 Jul 2023 11:16:43 +0000 (13:16 +0200)
For small regions, the optimization doesn't matter that much, so we
don't need to do lots of work on the CPU.

In particular, this should catch icons and their backgrounds (32x32),
but I was generous in selecting the number.

Gets my discrete AMD on widget-factory back to the 1900fps it had before
this optimization while making the driver clock the GPU's shader at
1.7GHz instead of the 2.1GHz it used before.

gsk/vulkan/gskvulkanrenderpass.c

index 51d849c1c6a3eb1d45befb27b875d2516d16dc05..a6d954c6f887dcb04dfdcbcc3a192e6234c0f0ae 100644 (file)
@@ -361,6 +361,7 @@ gsk_vulkan_render_pass_add_color_node (GskVulkanRenderPass       *self,
   graphene_rect_intersection (&state->clip.rect.bounds, &rect, &clipped);
 
   if (gdk_rgba_is_opaque (color) &&
+      node->bounds.size.width * node->bounds.size.height > 100 * 100 && /* not worth the effort for small images */
       gsk_vulkan_parse_rect_is_integer (state, &clipped, &int_clipped))
     {
       /* now handle all the clip */