[gtk/wip/chergert/glproto: 464/526] avoid converting to float[]




commit af346bdd1e1fa7ea5e5b8b1c39e8b2ce1a62d06d
Author: Christian Hergert <chergert redhat com>
Date:   Thu Feb 4 18:06:02 2021 -0800

    avoid converting to float[]

 gsk/next/gskglcommandqueue.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/gsk/next/gskglcommandqueue.c b/gsk/next/gskglcommandqueue.c
index 7b3a08e166..e188ae3a98 100644
--- a/gsk/next/gskglcommandqueue.c
+++ b/gsk/next/gskglcommandqueue.c
@@ -690,9 +690,16 @@ apply_uniform (gconstpointer    dataptr,
     break;
 
     case GSK_GL_UNIFORM_FORMAT_MATRIX: {
+#if 0
       float mat[16];
       graphene_matrix_to_float (dataptr, mat);
-      glUniformMatrix4fv (location, 1, GL_FALSE, mat);
+#else
+      /* We can avoid the transform to float it seems. Are there
+       * any platforms where this does not work?
+       */
+      G_STATIC_ASSERT (sizeof (graphene_matrix_t) == 16*4);
+      glUniformMatrix4fv (location, 1, GL_FALSE, dataptr);
+#endif
     }
     break;
 


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