[gtk+/wip/otte/shader: 21/21] gskspv: Implement writing constructor functions



commit 4de0d988a8073537a88a555bef1fbf11279b8b9a
Author: Benjamin Otte <otte redhat com>
Date:   Wed Oct 11 16:55:38 2017 +0200

    gskspv: Implement writing constructor functions
    
    Calling a constructor is a simple OpConstantComposite call. Who'd have
    thought.

 gsk/gskslfunction.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gsk/gskslfunction.c b/gsk/gskslfunction.c
index a94b7e6..122e810 100644
--- a/gsk/gskslfunction.c
+++ b/gsk/gskslfunction.c
@@ -162,9 +162,12 @@ gsk_sl_function_constructor_write_call_spv (GskSlFunction *function,
                                             GskSpvWriter  *writer,
                                             guint32       *arguments)
 {
-  g_assert_not_reached ();
+  const GskSlFunctionConstructor *constructor = (const GskSlFunctionConstructor *) function;
 
-  return 0;
+  return gsk_spv_writer_composite_construct (writer,
+                                             constructor->type,
+                                             arguments,
+                                             gsk_sl_type_get_n_members (constructor->type));
 }
 
 static const GskSlFunctionClass GSK_SL_FUNCTION_CONSTRUCTOR = {


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