From 0edd7547c1e095ede1e1f8c45dc93291b4913c33 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 12 Jul 2023 11:38:32 +0200 Subject: [PATCH] vulkan: Don't try that hard to use clear 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/gsk/vulkan/gskvulkanrenderpass.c b/gsk/vulkan/gskvulkanrenderpass.c index 51d849c1c6..a6d954c6f8 100644 --- a/gsk/vulkan/gskvulkanrenderpass.c +++ b/gsk/vulkan/gskvulkanrenderpass.c @@ -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 */ -- 2.30.2