mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-16 07:04:29 +00:00
Merge branch 'ngl-buffer-upload-counter' into 'main'
add counter for ngl buffer uploads See merge request GNOME/gtk!6997
This commit is contained in:
commit
26de2eae20
@ -1,5 +1,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include <gdk/gdkprofilerprivate.h>
|
||||||
|
|
||||||
#include "gskglbufferprivate.h"
|
#include "gskglbufferprivate.h"
|
||||||
|
|
||||||
struct _GskGLBuffer
|
struct _GskGLBuffer
|
||||||
@ -14,6 +16,9 @@ struct _GskGLBuffer
|
|||||||
|
|
||||||
G_DEFINE_TYPE (GskGLBuffer, gsk_gl_buffer, GSK_TYPE_GPU_BUFFER)
|
G_DEFINE_TYPE (GskGLBuffer, gsk_gl_buffer, GSK_TYPE_GPU_BUFFER)
|
||||||
|
|
||||||
|
static guint profiler_buffer_uploads_id;
|
||||||
|
static gint64 profiler_buffer_uploads;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gsk_gl_buffer_finalize (GObject *object)
|
gsk_gl_buffer_finalize (GObject *object)
|
||||||
{
|
{
|
||||||
@ -44,7 +49,9 @@ gsk_gl_buffer_unmap (GskGpuBuffer *buffer,
|
|||||||
|
|
||||||
gsk_gl_buffer_bind (self);
|
gsk_gl_buffer_bind (self);
|
||||||
|
|
||||||
|
profiler_buffer_uploads += used;
|
||||||
glBufferSubData (self->target, 0, used, self->data);
|
glBufferSubData (self->target, 0, used, self->data);
|
||||||
|
gdk_profiler_set_int_counter (profiler_buffer_uploads_id, profiler_buffer_uploads);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -57,6 +64,8 @@ gsk_gl_buffer_class_init (GskGLBufferClass *klass)
|
|||||||
buffer_class->unmap = gsk_gl_buffer_unmap;
|
buffer_class->unmap = gsk_gl_buffer_unmap;
|
||||||
|
|
||||||
gobject_class->finalize = gsk_gl_buffer_finalize;
|
gobject_class->finalize = gsk_gl_buffer_finalize;
|
||||||
|
|
||||||
|
profiler_buffer_uploads_id = gdk_profiler_define_int_counter ("ngl-buffer-uploads", "Number of bytes uploaded to GPU");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user