glsl: added slang_operation_literal_int/bool() helper functions
authorBrian Paul <brianp@vmware.com>
Thu, 18 Jun 2009 22:57:53 +0000 (16:57 -0600)
committerBrian Paul <brianp@vmware.com>
Fri, 26 Jun 2009 19:16:32 +0000 (13:16 -0600)
src/mesa/shader/slang/slang_compile_operation.h

index 627356bb5671b39fa3e6bc4ebb8294d6e7795bd5..f07aa1c02e7e8490fb4fe6734ac10074e5f29984 100644 (file)
@@ -172,4 +172,30 @@ slang_oper_child(slang_operation *oper, GLuint child)
 }
 
 
+/** Init oper to a boolean literal. */
+static INLINE void
+slang_operation_literal_bool(slang_operation *oper, GLboolean value)
+{
+   oper->type = SLANG_OPER_LITERAL_BOOL;
+   oper->literal[0] =
+   oper->literal[1] =
+   oper->literal[2] =
+   oper->literal[3] = (float) value;
+   oper->literal_size = 1;
+}
+
+
+/** Init oper to an int literal. */
+static INLINE void
+slang_operation_literal_int(slang_operation *oper, GLint value)
+{
+   oper->type = SLANG_OPER_LITERAL_INT;
+   oper->literal[0] =
+   oper->literal[1] =
+   oper->literal[2] =
+   oper->literal[3] = (float) value;
+   oper->literal_size = 1;
+}
+
+
 #endif /* SLANG_COMPILE_OPERATION_H */