From f26efd9adf1ea3a8cae746b0dae303dc0f64da3f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 22 Apr 2024 20:47:25 -0400 Subject: [PATCH] gsk: Add a profiler mark for pipeline creation This is the Vulkan equivalent of shader compilation, it could be expensive, so lets add a mark around it. --- gsk/gpu/gskvulkandevice.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gsk/gpu/gskvulkandevice.c b/gsk/gpu/gskvulkandevice.c index a542f937c2..a3a1a83be1 100644 --- a/gsk/gpu/gskvulkandevice.c +++ b/gsk/gpu/gskvulkandevice.c @@ -9,6 +9,7 @@ #include "gdk/gdkdisplayprivate.h" #include "gdk/gdkvulkancontextprivate.h" +#include "gdk/gdkprofilerprivate.h" struct _GskVulkanDevice { @@ -949,6 +950,7 @@ gsk_vulkan_device_get_vk_pipeline (GskVulkanDevice *self, GdkDisplay *display; const char *version_string; char *vertex_shader_name, *fragment_shader_name; + G_GNUC_UNUSED gint64 begin_time = GDK_PROFILER_CURRENT_TIME; cache_key = (PipelineCacheKey) { .op_class = op_class, @@ -1125,6 +1127,10 @@ gsk_vulkan_device_get_vk_pipeline (GskVulkanDevice *self, NULL, &pipeline); + gdk_profiler_end_markf (begin_time, + "Create Vulkan pipeline frag=%s vert=%s", + fragment_shader_name, vertex_shader_name); + g_free (fragment_shader_name); g_free (vertex_shader_name);