[gtk/wip/chergert/glproto: 173/526] increase alignment for dynamic uniform state




commit b413e925afc24e8e184a6c8a535f986bc0cb46f7
Author: Christian Hergert <chergert redhat com>
Date:   Fri Jan 1 23:05:08 2021 -0800

    increase alignment for dynamic uniform state
    
    these need to be aligned more so that SIMD operations will work.

 gsk/next/gskgluniformstate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gsk/next/gskgluniformstate.c b/gsk/next/gskgluniformstate.c
index ffa7eac504..239a3ee789 100644
--- a/gsk/next/gskgluniformstate.c
+++ b/gsk/next/gskgluniformstate.c
@@ -134,7 +134,7 @@ alloc_uniform_data (GByteArray *buffer,
                     guint       size,
                     guint      *offset)
 {
-  guint align = size > 4 ? GLIB_SIZEOF_VOID_P : 4;
+  guint align = size > 8 ? 16 : (size > 4 ? 8 : 4);
   guint masked = buffer->len & (align - 1);
   guint old_len = buffer->len;
 


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