From ceaf57524b6daaba3b083f441a8e0a98f98cebde Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 12 Dec 2008 15:11:08 -0700 Subject: [PATCH] mesa: remove unused varpool code in glsl compiler (cherry picked from commit 81253be3347312eb7539eb61ee9362f76370eba7) --- src/mesa/shader/slang/slang_compile.c | 16 ---------------- src/mesa/shader/slang/slang_compile.h | 7 ------- src/mesa/shader/slang/slang_compile_variable.c | 2 -- src/mesa/shader/slang/slang_compile_variable.h | 1 - 4 files changed, 26 deletions(-) diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 5b792e9fb6e..7d609bdcd66 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -74,18 +74,6 @@ legal_identifier(slang_atom name) } -/** - * Allocate storage for a variable of 'size' bytes from given pool. - * Return the allocated address for the variable. - */ -static GLuint -slang_var_pool_alloc(slang_var_pool * pool, unsigned int size) -{ - const GLuint addr = pool->next_addr; - pool->next_addr += size; - return addr; -} - /* * slang_code_unit */ @@ -120,7 +108,6 @@ _slang_code_object_ctr(slang_code_object * self) for (i = 0; i < SLANG_BUILTIN_TOTAL; i++) _slang_code_unit_ctr(&self->builtin[i], self); _slang_code_unit_ctr(&self->unit, self); - self->varpool.next_addr = 0; slang_atom_pool_construct(&self->atompool); } @@ -156,7 +143,6 @@ typedef struct slang_output_ctx_ slang_variable_scope *vars; slang_function_scope *funs; slang_struct_scope *structs; - slang_var_pool *global_pool; struct gl_program *program; slang_var_table *vartable; GLuint default_precision[TYPE_SPECIFIER_COUNT]; @@ -2058,7 +2044,6 @@ parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O, && var->array_len == 0)) { if (!calculate_var_size(C, O, var)) return GL_FALSE; - var->address = slang_var_pool_alloc(O->global_pool, var->size); } /* emit code for global var decl */ @@ -2358,7 +2343,6 @@ parse_code_unit(slang_parse_ctx * C, slang_code_unit * unit, o.funs = &unit->funs; o.structs = &unit->structs; o.vars = &unit->vars; - o.global_pool = &unit->object->varpool; o.program = shader ? shader->Program : NULL; o.vartable = _slang_new_var_table(maxRegs); _slang_push_var_table(o.vartable); diff --git a/src/mesa/shader/slang/slang_compile.h b/src/mesa/shader/slang/slang_compile.h index d0f0bfc8fba..7fb549d33d2 100644 --- a/src/mesa/shader/slang/slang_compile.h +++ b/src/mesa/shader/slang/slang_compile.h @@ -53,12 +53,6 @@ typedef enum slang_unit_type_ } slang_unit_type; -typedef struct slang_var_pool_ -{ - GLuint next_addr; -} slang_var_pool; - - typedef struct slang_code_unit_ { slang_variable_scope vars; @@ -86,7 +80,6 @@ typedef struct slang_code_object_ { slang_code_unit builtin[SLANG_BUILTIN_TOTAL]; slang_code_unit unit; - slang_var_pool varpool; slang_atom_pool atompool; } slang_code_object; diff --git a/src/mesa/shader/slang/slang_compile_variable.c b/src/mesa/shader/slang/slang_compile_variable.c index 18e0f91a8fa..eab912710e8 100644 --- a/src/mesa/shader/slang/slang_compile_variable.c +++ b/src/mesa/shader/slang/slang_compile_variable.c @@ -164,7 +164,6 @@ slang_variable_construct(slang_variable * var) var->a_name = SLANG_ATOM_NULL; var->array_len = 0; var->initializer = NULL; - var->address = ~0; var->size = 0; var->isTemp = GL_FALSE; var->store = NULL; @@ -219,7 +218,6 @@ slang_variable_copy(slang_variable * x, const slang_variable * y) return 0; } } - z.address = y->address; z.size = y->size; slang_variable_destruct(x); *x = z; diff --git a/src/mesa/shader/slang/slang_compile_variable.h b/src/mesa/shader/slang/slang_compile_variable.h index 4a33dcc4122..a667d91b471 100644 --- a/src/mesa/shader/slang/slang_compile_variable.h +++ b/src/mesa/shader/slang/slang_compile_variable.h @@ -38,7 +38,6 @@ typedef struct slang_variable_ slang_atom a_name; /**< The variable's name (char *) */ GLuint array_len; /**< only if type == SLANG_SPEC_ARRAy */ struct slang_operation_ *initializer; /**< Optional initializer code */ - GLuint address; /**< Storage location */ GLuint size; /**< Variable's size in bytes */ GLboolean isTemp; /**< a named temporary (__resultTmp) */ GLboolean declared; /**< for debug */ -- 2.30.2