summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian <brian@yutani.localnet.net>2007-03-14 11:07:32 -0600
committerBrian <brian@yutani.localnet.net>2007-03-14 11:07:32 -0600
commit565d097d8feb201a0be2ee41f0413cac2593990f (patch)
tree2d8ba0be3ea2cdec10e962356739508bf9111f82
parent2dc3e944704dd90eb4324babac070b7e2fff70fc (diff)
continue prev check-in: save ptr to slang_function for SLANG_OPER_CALL
-rw-r--r--src/mesa/shader/slang/slang_typeinfo.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/mesa/shader/slang/slang_typeinfo.c b/src/mesa/shader/slang/slang_typeinfo.c
index a9e1261746..fef5575631 100644
--- a/src/mesa/shader/slang/slang_typeinfo.c
+++ b/src/mesa/shader/slang/slang_typeinfo.c
@@ -576,17 +576,24 @@ _slang_typeof_operation_(slang_operation * op,
}
break;
case SLANG_OPER_CALL:
- {
+ if (op->fun) {
+ /* we've resolved this call before */
+ slang_type_specifier_copy(&ti->spec, &op->fun->header.type.specifier);
+ }
+ else {
slang_function *fun;
-
if (!_slang_typeof_function(op->a_id, op->children, op->num_children,
space, &ti->spec, &fun, atoms, log))
return GL_FALSE;
- if (!fun) {
- /* Look for struct initializer? */
+ if (fun) {
+ /* save result for future use */
+ op->fun = fun;
+ }
+ else {
slang_struct *s =
slang_struct_scope_find(space->structs, op->a_id, GL_TRUE);
- if (s != NULL) {
+ if (s) {
+ /* struct initializer */
ti->spec.type = SLANG_SPEC_STRUCT;
ti->spec._struct =
(slang_struct *) slang_alloc_malloc(sizeof(slang_struct));
@@ -601,6 +608,7 @@ _slang_typeof_operation_(slang_operation * op,
return GL_FALSE;
}
else {
+ /* float, int, vec4, mat3, etc. constructor? */
const char *name;
slang_type_specifier_type type;