Merge branch 'matthiasc/for-main' into 'main'

gsk: Improve logging

See merge request GNOME/gtk!7207
This commit is contained in:
Matthias Clasen
2024-04-30 11:59:06 +00:00
2 changed files with 27 additions and 3 deletions

View File

@@ -1111,6 +1111,7 @@ gdk_display_load_pipeline_cache (GdkDisplay *display)
static gboolean
gdk_vulkan_save_pipeline_cache (GdkDisplay *display)
{
G_GNUC_UNUSED gint64 begin_time = GDK_PROFILER_CURRENT_TIME;
GError *error = NULL;
VkDevice device;
VkPipelineCache cache;
@@ -1167,7 +1168,7 @@ gdk_vulkan_save_pipeline_cache (GdkDisplay *display)
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_WRONG_ETAG))
{
VkPipelineCache new_cache;
GDK_DEBUG (VULKAN, "Pipeline cache file modified, merging into current");
new_cache = gdk_display_load_pipeline_cache (display);
if (new_cache)
@@ -1194,6 +1195,10 @@ gdk_vulkan_save_pipeline_cache (GdkDisplay *display)
return FALSE;
}
gdk_profiler_end_markf (begin_time,
"Save Vulkan pipeline cache", "%s size %ld",
g_file_peek_path (file), size);
g_object_unref (file);
g_free (data);
g_free (display->vk_pipeline_cache_etag);

View File

@@ -951,6 +951,8 @@ gsk_vulkan_device_get_vk_pipeline (GskVulkanDevice *self,
const char *version_string;
char *vertex_shader_name, *fragment_shader_name;
G_GNUC_UNUSED gint64 begin_time = GDK_PROFILER_CURRENT_TIME;
const char *clip_name[] = { "NONE", "RECT", "ROUNDED" };
const char *blend_name[] = { "OVER", "ADD", "CLEAR" };
cache_key = (PipelineCacheKey) {
.op_class = op_class,
@@ -1128,8 +1130,25 @@ gsk_vulkan_device_get_vk_pipeline (GskVulkanDevice *self,
&pipeline);
gdk_profiler_end_markf (begin_time,
"Create Vulkan pipeline", "frag=%s vert=%s",
fragment_shader_name, vertex_shader_name);
"Create Vulkan pipeline", "%s version=%s variation=%u clip=%s blend=%s format=%u",
op_class->shader_name,
version_string + 1,
variation,
clip_name[clip],
blend_name[blend],
format);
GSK_DEBUG (SHADERS,
"Create Vulkan pipeline (%s %s, %u/%s/%s/%u) for layout (%lu/%lu/%lu)",
op_class->shader_name,
version_string + 1,
variation,
clip_name[clip],
blend_name[blend],
format,
layout->setup.n_buffers,
layout->setup.n_samplers,
layout->setup.n_immutable_samplers);
g_free (fragment_shader_name);
g_free (vertex_shader_name);