diff options
author | Brian <[email protected]> | 2007-02-02 12:02:53 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2007-02-02 12:02:53 -0700 |
commit | 06daf74a7131fa092139d09ad7d035f737bc3fe1 (patch) | |
tree | e54408cc1d3b3853b7154feec4015c6a4a9d6500 | |
parent | 70570d41996a3754be973ffdc34cd3ae4267878d (diff) |
use _slang_simplify() to evaluate array sizes
-rw-r--r-- | src/mesa/shader/slang/slang_compile.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 65329c9db19..4203c3cc6f2 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -40,6 +40,7 @@ #include "slang_error.h" #include "slang_emit.h" #include "slang_vartable.h" +#include "slang_simplify.h" #include "slang_print.h" @@ -367,8 +368,11 @@ parse_array_len(slang_parse_ctx * C, slang_output_ctx * O, GLuint * len) space.funcs = O->funs; space.structs = O->structs; space.vars = O->vars; - result = _slang_evaluate_int(O->assembly, O->machine, &space, - &array_size, len, C->atoms); + + /* evaluate compile-time expression which is array size */ + _slang_simplify(&array_size, &space, C->atoms); + result = (array_size.type == slang_oper_literal_int); + slang_operation_destruct(&array_size); return result; } |