[gtk/wip/chergert/glproto: 402/493] avoid converting to float[]




commit cfcb29c869c53dc6d04998b6e08235fffdf58680
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]