summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/slang
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-06-18 16:57:53 -0600
committerBrian Paul <[email protected]>2009-06-26 13:16:32 -0600
commit7e0eaca201c0a5678752e9d3de6f699ff8281f75 (patch)
tree052fb93f79bd0459ffaf9920dce86813d68d07b7 /src/mesa/shader/slang
parentc1f74a6734494d0531eb7dc844bb83e7d9c9f1fa (diff)
glsl: added slang_operation_literal_int/bool() helper functions
Diffstat (limited to 'src/mesa/shader/slang')
-rw-r--r--src/mesa/shader/slang/slang_compile_operation.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/slang_compile_operation.h b/src/mesa/shader/slang/slang_compile_operation.h
index 627356bb567..f07aa1c02e7 100644
--- a/src/mesa/shader/slang/slang_compile_operation.h
+++ b/src/mesa/shader/slang/slang_compile_operation.h
@@ -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 */