[gtk/wip/chergert/glproto] add helper to get format size



commit 27b69a0a2619be8c120a6a837546bc28c5cba28b
Author: Christian Hergert <chergert redhat com>
Date:   Mon Feb 1 22:08:48 2021 -0800

    add helper to get format size
    
    just useful for debugging, nothing else really

 gsk/next/gskgluniformstate.c        | 9 +++++++++
 gsk/next/gskgluniformstateprivate.h | 1 +
 2 files changed, 10 insertions(+)
---
diff --git a/gsk/next/gskgluniformstate.c b/gsk/next/gskgluniformstate.c
index 5bf13dbbba..7879753a35 100644
--- a/gsk/next/gskgluniformstate.c
+++ b/gsk/next/gskgluniformstate.c
@@ -879,3 +879,12 @@ gsk_gl_uniform_state_end_frame (GskGLUniformState *state)
   g_clear_pointer (&state->uniform_data, g_byte_array_unref);
   state->uniform_data = buffer;
 }
+
+gsize
+gsk_gl_uniform_format_size (GskGLUniformFormat format)
+{
+  g_assert (format > 0);
+  g_assert (format < GSK_GL_UNIFORM_FORMAT_LAST);
+
+  return uniform_sizes[format];
+}
diff --git a/gsk/next/gskgluniformstateprivate.h b/gsk/next/gskgluniformstateprivate.h
index 609bba87d0..f170142acf 100644
--- a/gsk/next/gskgluniformstateprivate.h
+++ b/gsk/next/gskgluniformstateprivate.h
@@ -180,6 +180,7 @@ void               gsk_gl_uniform_state_snapshot         (GskGLUniformState
                                                           guint                      program_id,
                                                           GskGLUniformStateCallback  callback,
                                                           gpointer                   user_data);
+gsize              gsk_gl_uniform_format_size            (GskGLUniformFormat         format);
 
 static inline gconstpointer
 gsk_gl_uniform_state_get_uniform_data (GskGLUniformState *state,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]