move _slang_locate_function()
authorBrian <brian@yutani.localnet.net>
Fri, 2 Feb 2007 23:10:02 +0000 (16:10 -0700)
committerBrian <brian@yutani.localnet.net>
Fri, 2 Feb 2007 23:10:02 +0000 (16:10 -0700)
src/mesa/shader/slang/slang_codegen.c
src/mesa/shader/slang/slang_typeinfo.c
src/mesa/shader/slang/slang_typeinfo.h

index 295292e076144ef41068de46898f457a492f312d..17d1a6bb82fa227488dc74f449c242126add44d9 100644 (file)
@@ -1264,58 +1264,6 @@ _slang_first_function(struct slang_function_scope_ *scope, const char *name)
 
 
 
-slang_function *
-_slang_locate_function(const slang_function_scope * funcs, slang_atom a_name,
-                       const slang_operation * args, GLuint num_args,
-                       const slang_name_space * space,
-                       slang_atom_pool * atoms)
-{
-   GLuint i;
-
-   for (i = 0; i < funcs->num_functions; i++) {
-      slang_function *f = &funcs->functions[i];
-      const GLuint haveRetValue = _slang_function_has_return_value(f);
-      GLuint j;
-
-      if (a_name != f->header.a_name)
-         continue;
-      if (f->param_count - haveRetValue != num_args)
-         continue;
-
-      /* compare parameter / argument types */
-      for (j = 0; j < num_args; j++) {
-         slang_typeinfo ti;
-
-         if (!slang_typeinfo_construct(&ti))
-            return NULL;
-         if (!_slang_typeof_operation_(&args[j], space, &ti, atoms)) {
-            slang_typeinfo_destruct(&ti);
-            return NULL;
-         }
-         if (!slang_type_specifier_equal(&ti.spec,
-             &f->parameters->variables[j/* + haveRetValue*/]->type.specifier)) {
-            slang_typeinfo_destruct(&ti);
-            break;
-         }
-         slang_typeinfo_destruct(&ti);
-
-         /* "out" and "inout" formal parameter requires the actual parameter to be l-value */
-         if (!ti.can_be_referenced &&
-             (f->parameters->variables[j/* + haveRetValue*/]->type.qualifier == slang_qual_out ||
-              f->parameters->variables[j/* + haveRetValue*/]->type.qualifier == slang_qual_inout))
-            break;
-      }
-      if (j == num_args)
-         return f;
-   }
-   if (funcs->outer_scope != NULL)
-      return _slang_locate_function(funcs->outer_scope, a_name, args,
-                                    num_args, space, atoms);
-   return NULL;
-}
-
-
-
 /**
  * Assemble a function call, given a particular function name.
  * \param name  the function's name (operators like '*' are possible).
index cfed54276d74a65cd31fc2dd9ee2498995651fe4..8bedb40435ab0e54d41439a2dc272f9afab02ee5 100644 (file)
@@ -604,6 +604,58 @@ _slang_typeof_operation_(const slang_operation * op,
 
 
 
+slang_function *
+_slang_locate_function(const slang_function_scope * funcs, slang_atom a_name,
+                       const slang_operation * args, GLuint num_args,
+                       const slang_name_space * space,
+                       slang_atom_pool * atoms)
+{
+   GLuint i;
+
+   for (i = 0; i < funcs->num_functions; i++) {
+      slang_function *f = &funcs->functions[i];
+      const GLuint haveRetValue = _slang_function_has_return_value(f);
+      GLuint j;
+
+      if (a_name != f->header.a_name)
+         continue;
+      if (f->param_count - haveRetValue != num_args)
+         continue;
+
+      /* compare parameter / argument types */
+      for (j = 0; j < num_args; j++) {
+         slang_typeinfo ti;
+
+         if (!slang_typeinfo_construct(&ti))
+            return NULL;
+         if (!_slang_typeof_operation_(&args[j], space, &ti, atoms)) {
+            slang_typeinfo_destruct(&ti);
+            return NULL;
+         }
+         if (!slang_type_specifier_equal(&ti.spec,
+             &f->parameters->variables[j/* + haveRetValue*/]->type.specifier)) {
+            slang_typeinfo_destruct(&ti);
+            break;
+         }
+         slang_typeinfo_destruct(&ti);
+
+         /* "out" and "inout" formal parameter requires the actual parameter to be l-value */
+         if (!ti.can_be_referenced &&
+             (f->parameters->variables[j/* + haveRetValue*/]->type.qualifier == slang_qual_out ||
+              f->parameters->variables[j/* + haveRetValue*/]->type.qualifier == slang_qual_inout))
+            break;
+      }
+      if (j == num_args)
+         return f;
+   }
+   if (funcs->outer_scope != NULL)
+      return _slang_locate_function(funcs->outer_scope, a_name, args,
+                                    num_args, space, atoms);
+   return NULL;
+}
+
+
+
 /**
  * Determine the return type of a function.
  * \param a_name  the function name
index 2b565dfd242ad21128de8bbc5421568d998b725c..6e27079ff897d66a7a643eae4e9f268b707497c4 100644 (file)
@@ -58,15 +58,14 @@ typedef struct slang_assemble_ctx_
 {
    slang_atom_pool *atoms;
    slang_name_space space;
-   slang_swizzle swz;
    struct gl_program *program;
    slang_var_table *vartable;
-
    struct slang_function_ *CurFunction;
    slang_atom CurLoopBreak;
    slang_atom CurLoopCont;
 } slang_assemble_ctx;
 
+
 extern struct slang_function_ *
 _slang_locate_function(const struct slang_function_scope_ *funcs,
                        slang_atom name, const struct slang_operation_ *params,