[gtk/wip/chergert/glproto: 480/493] steal another bit from array count




commit 1004d7511df1cfea23ec6f4b5b963b3fe77c3088
Author: Christian Hergert <chergert redhat com>
Date:   Tue Feb 16 20:53:50 2021 -0800

    steal another bit from array count
    
    we don't use anything that large in the code base, so we can have another
    bit here.

 gsk/next/gskgluniformstate.c        | 2 +-
 gsk/next/gskgluniformstateprivate.h | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gsk/next/gskgluniformstate.c b/gsk/next/gskgluniformstate.c
index 4422b05552..73addf918f 100644
--- a/gsk/next/gskgluniformstate.c
+++ b/gsk/next/gskgluniformstate.c
@@ -101,7 +101,7 @@ gsk_gl_uniform_state_init_value (GskGLUniformState        *state,
   guint offset;
 
   g_assert (state != NULL);
-  g_assert (array_count < 64);
+  g_assert (array_count < 32);
   g_assert ((int)format >= 0 && format < GSK_GL_UNIFORM_FORMAT_LAST);
   g_assert (format > 0);
   g_assert (program != NULL);
diff --git a/gsk/next/gskgluniformstateprivate.h b/gsk/next/gskgluniformstateprivate.h
index db670a224f..35b5bcfbaf 100644
--- a/gsk/next/gskgluniformstateprivate.h
+++ b/gsk/next/gskgluniformstateprivate.h
@@ -40,9 +40,9 @@ typedef struct { guint v0; } Uniform1ui;
 typedef struct _GskGLUniformInfo
 {
   guint format : 5;
-  guint array_count : 6;
+  guint array_count : 5;
   guint initial : 1;
-  guint offset : 20;
+  guint offset : 21;
 } GskGLUniformInfo;
 
 G_STATIC_ASSERT (sizeof (GskGLUniformInfo) == 4);
@@ -233,7 +233,7 @@ gsk_gl_uniform_state_realloc (GskGLUniformState *state,
       {                                                                                   \
         guint offset;                                                                     \
         u = gsk_gl_uniform_state_realloc (state, sizeof(type) * MAX (1, count), &offset); \
-        g_assert (offset < (1 << 20));                                                    \
+        g_assert (offset < (1 << 21));                                                    \
         (info)->info.offset = offset;                                                     \
         /* We might have increased array length */                                        \
         (info)->info.array_count = count;                                                 \


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