mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 20:38:06 +02:00
glsl: added slang_operation_literal_int/bool() helper functions
This commit is contained in:
parent
c1f74a6734
commit
7e0eaca201
1 changed files with 26 additions and 0 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue