#include "gskvulkanglyphcacheprivate.h"
#include "gdk/gdktextureprivate.h"
+#include "gdk/gdkprofilerprivate.h"
#include <graphene.h>
} ProfileTimers;
#endif
+static guint texture_pixels_counter;
+static guint fallback_pixels_counter;
+
struct _GskVulkanRenderer
{
GskRenderer parent_instance;
GdkTexture *texture;
#ifdef G_ENABLE_DEBUG
GskProfiler *profiler;
- gint64 cpu_time;
+ gint64 cpu_time, start_time;
#endif
#ifdef G_ENABLE_DEBUG
gsk_vulkan_render_free (render);
#ifdef G_ENABLE_DEBUG
+ start_time = gsk_profiler_timer_get_start (profiler, self->profile_timers.cpu_time);
cpu_time = gsk_profiler_timer_end (profiler, self->profile_timers.cpu_time);
gsk_profiler_timer_set (profiler, self->profile_timers.cpu_time, cpu_time);
gsk_profiler_push_samples (profiler);
+
+ if (gdk_profiler_is_running ())
+ {
+ gdk_profiler_add_mark (start_time, cpu_time, "render", "");
+ gdk_profiler_set_int_counter (texture_pixels_counter,
+ start_time + cpu_time,
+ gsk_profiler_counter_get (profiler, self->profile_counters.texture_pixels));
+ gdk_profiler_set_int_counter (fallback_pixels_counter,
+ start_time + cpu_time,
+ gsk_profiler_counter_get (profiler, self->profile_counters.fallback_pixels));
+ }
#endif
return texture;
self->profile_timers.cpu_time = gsk_profiler_add_timer (profiler, "cpu-time", "CPU time", FALSE, TRUE);
if (GSK_RENDERER_DEBUG_CHECK (GSK_RENDERER (self), SYNC))
self->profile_timers.gpu_time = gsk_profiler_add_timer (profiler, "gpu-time", "GPU time", FALSE, TRUE);
+
+ if (texture_pixels_counter == 0)
+ {
+ texture_pixels_counter = gdk_profiler_define_int_counter ("texture-pixels", "Texture Pixels");
+ fallback_pixels_counter = gdk_profiler_define_int_counter ("fallback-pixels", "Fallback Pixels");
+ }
+
#endif
}