}
/* destroy the existing function declaration and replace it
- * with the new one, remember to save the fixup table
+ * with the new one
*/
- //parsed_func.fixups = found_func->fixups;
- //slang_fixup_table_init(&found_func->fixups);
slang_function_destruct(found_func);
*found_func = parsed_func;
}
#include "slang_compile.h"
#include "slang_mem.h"
-/* slang_fixup_table */
-
-void
-slang_fixup_table_init(slang_fixup_table * fix)
-{
- fix->table = NULL;
- fix->count = 0;
-}
-
-void
-slang_fixup_table_free(slang_fixup_table * fix)
-{
- _slang_free(fix->table);
- slang_fixup_table_init(fix);
-}
-
-/**
- * Add a new fixup address to the table.
- */
-GLboolean
-slang_fixup_save(slang_fixup_table *fixups, GLuint address)
-{
- fixups->table = (GLuint *)
- _slang_realloc(fixups->table,
- fixups->count * sizeof(GLuint),
- (fixups->count + 1) * sizeof(GLuint));
- if (fixups->table == NULL)
- return GL_FALSE;
- fixups->table[fixups->count] = address;
- fixups->count++;
- return GL_TRUE;
-}
-
-
-
-/* slang_function */
int
slang_function_construct(slang_function * func)
_slang_variable_scope_ctr(func->parameters);
func->param_count = 0;
func->body = NULL;
- //func->address = ~0;
- //slang_fixup_table_init(&func->fixups);
return 1;
}
slang_operation_destruct(func->body);
_slang_free(func->body);
}
- //slang_fixup_table_free(&func->fixups);
}
/**
- * When we need to fill in addresses which we won't know until the future,
- * we keep track of them with a fix-up table.
- */
-typedef struct slang_fixup_table_
-{
- GLuint *table; /**< array[count] of addresses */
- GLuint count;
-} slang_fixup_table;
-
-extern void slang_fixup_table_init(slang_fixup_table *);
-extern void slang_fixup_table_free(slang_fixup_table *);
-extern GLboolean slang_fixup_save(slang_fixup_table *fixups, GLuint address);
-
-
-/**
* Description of a compiled shader function.
*/
typedef struct slang_function_
slang_variable_scope *parameters; /**< formal parameters AND local vars */
unsigned int param_count; /**< number of formal params (no locals) */
slang_operation *body; /**< The instruction tree */
-#if 0
- unsigned int address; /**< Address of this func in memory */
- slang_fixup_table fixups; /**< Mem locations which need func's address */
-#endif
} slang_function;
extern int slang_function_construct(slang_function *);