summaryrefslogtreecommitdiff
path: root/src/mesa/shader/slang/slang_compile.c
diff options
context:
space:
mode:
authorBrian <brian@yutani.localnet.net>2007-02-03 17:24:24 -0700
committerBrian <brian@yutani.localnet.net>2007-02-03 17:24:24 -0700
commit93b975a1d9fcc4a10987676f7368809522f27d71 (patch)
treeebf408cfd8fbca10dea39eb594346e4fe03636b9 /src/mesa/shader/slang/slang_compile.c
parent5ee684cba9b1f63090e184125e5890da4fc1d28c (diff)
Add literal_size field to slang_operation.
Used to track the number of components in a float/int/bool literal. Helps with some typechecking things. Fixes problems with calls such as "distance(v2, vec2(1.0, 2.0))"
Diffstat (limited to 'src/mesa/shader/slang/slang_compile.c')
-rw-r--r--src/mesa/shader/slang/slang_compile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c
index 619fe50ce5..199f96e441 100644
--- a/src/mesa/shader/slang/slang_compile.c
+++ b/src/mesa/shader/slang/slang_compile.c
@@ -1029,6 +1029,7 @@ parse_expression(slang_parse_ctx * C, slang_output_ctx * O,
op->literal[1] =
op->literal[2] =
op->literal[3] = (GLfloat) number;
+ op->literal_size = 1;
break;
case OP_PUSH_INT:
op->type = slang_oper_literal_int;
@@ -1038,6 +1039,7 @@ parse_expression(slang_parse_ctx * C, slang_output_ctx * O,
op->literal[1] =
op->literal[2] =
op->literal[3] = (GLfloat) number;
+ op->literal_size = 1;
break;
case OP_PUSH_FLOAT:
op->type = slang_oper_literal_float;
@@ -1046,6 +1048,7 @@ parse_expression(slang_parse_ctx * C, slang_output_ctx * O,
op->literal[1] =
op->literal[2] =
op->literal[3] = op->literal[0];
+ op->literal_size = 1;
break;
case OP_PUSH_IDENTIFIER:
op->type = slang_oper_identifier;