diff options
author | Brian Paul <brianp@vmware.com> | 2009-06-18 16:57:53 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-06-18 16:57:53 -0600 |
commit | 46bf008b76547f53575efdd43c3c01fba73da60c (patch) | |
tree | 8e75a9b74ae8fb7657fc6723ee3aa173ba53ffb7 | |
parent | fae7462dc59a0397f522dc213e0dbb589e4a5b89 (diff) |
glsl: added slang_operation_literal_int/bool() helper functions
-rw-r--r-- | src/mesa/shader/slang/slang_compile_operation.h | 26 |
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 627356bb56..f07aa1c02e 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 */ |