diff options
author | Brian <[email protected]> | 2007-02-02 14:24:24 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2007-02-02 14:24:24 -0700 |
commit | 1b24e2d5a7a7f97c179d7881a014f4aa025cacf7 (patch) | |
tree | 31c2438e52cbc059b9487f350450bbfa662a2355 /src/mesa/shader | |
parent | 5072fd3a641fa31cbfa7ecfbb34b2d8e782f9e06 (diff) |
remove slang_export.c and related code
Diffstat (limited to 'src/mesa/shader')
-rw-r--r-- | src/mesa/shader/slang/slang_assemble.c | 16 | ||||
-rw-r--r-- | src/mesa/shader/slang/slang_assemble_assignment.c | 5 | ||||
-rw-r--r-- | src/mesa/shader/slang/slang_compile.c | 51 | ||||
-rw-r--r-- | src/mesa/shader/slang/slang_compile.h | 8 | ||||
-rw-r--r-- | src/mesa/shader/slang/slang_compile_function.c | 46 | ||||
-rw-r--r-- | src/mesa/shader/slang/slang_compile_function.h | 6 | ||||
-rw-r--r-- | src/mesa/shader/slang/slang_compile_variable.c | 67 | ||||
-rw-r--r-- | src/mesa/shader/slang/slang_compile_variable.h | 5 | ||||
-rw-r--r-- | src/mesa/shader/slang/slang_storage.c | 8 |
9 files changed, 1 insertions, 211 deletions
diff --git a/src/mesa/shader/slang/slang_assemble.c b/src/mesa/shader/slang/slang_assemble.c index e3b65a12383..e65bf38ad51 100644 --- a/src/mesa/shader/slang/slang_assemble.c +++ b/src/mesa/shader/slang/slang_assemble.c @@ -33,9 +33,8 @@ #include "slang_compile.h" #include "slang_storage.h" #include "slang_error.h" - #include "slang_print.h" -/*#include "assemble2.c"*/ + /* slang_assembly */ @@ -481,11 +480,6 @@ dereference_basic(slang_assemble_ctx * A, slang_storage_type type, case slang_stor_float: ty = slang_asm_float_deref; break; -#if 0/*defined(USE_X86_ASM) || defined(SLANG_X86)*/ - case slang_stor_vec4: - ty = slang_asm_vec4_deref; - break; -#endif default: _mesa_problem(NULL, "Unexpected arr->type in dereference_basic"); ty = slang_asm_none; @@ -829,14 +823,6 @@ equality_aggregate(slang_assemble_ctx * A, return GL_FALSE; } else { -#if 0/*defined(USE_X86_ASM) || defined(SLANG_X86)*/ - if (arr->type == slang_stor_vec4) { - if (!PLAB2(A->file, slang_asm_vec4_equal_int, - size + *index, *index)) - return GL_FALSE; - } - else -#endif if (!PLAB2(A->file, slang_asm_float_equal_int, size + *index, *index)) return GL_FALSE; diff --git a/src/mesa/shader/slang/slang_assemble_assignment.c b/src/mesa/shader/slang/slang_assemble_assignment.c index 93a1ef3a081..6efc0f558a0 100644 --- a/src/mesa/shader/slang/slang_assemble_assignment.c +++ b/src/mesa/shader/slang/slang_assemble_assignment.c @@ -79,11 +79,6 @@ assign_basic(slang_assemble_ctx * A, slang_storage_type type, GLuint * index, case slang_stor_float: ty = slang_asm_float_copy; break; -#if 0/*defined(USE_X86_ASM) || defined(SLANG_X86)*/ - case slang_stor_vec4: - ty = slang_asm_vec4_copy; - break; -#endif default: _mesa_problem(NULL, "Unexpected arr->type in assign_basic"); ty = slang_asm_none; diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 8148c65a55d..9f7f18167d8 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -105,10 +105,6 @@ _slang_code_object_ctr(slang_code_object * self) #endif self->varpool.next_addr = 0; slang_atom_pool_construct(&self->atompool); - slang_export_data_table_ctr(&self->expdata); - self->expdata.atoms = &self->atompool; - slang_export_code_table_ctr(&self->expcode); - self->expcode.atoms = &self->atompool; } GLvoid @@ -123,8 +119,6 @@ _slang_code_object_dtr(slang_code_object * self) slang_assembly_file_destruct(&self->assembly); #endif slang_atom_pool_destruct(&self->atompool); - slang_export_data_table_dtr(&self->expdata); - slang_export_code_table_ctr(&self->expcode); } /* slang_info_log */ @@ -1730,9 +1724,6 @@ parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O, A.space.structs = O->structs; A.space.vars = O->vars; A.program = O->program; -#if 0 - A.codegen = O->codegen; -#endif A.vartable = O->vartable; _slang_codegen_global_variable(&A, var, C->type); @@ -1890,9 +1881,6 @@ parse_function(slang_parse_ctx * C, slang_output_ctx * O, int definition, A.space.structs = O->structs; A.space.vars = O->vars; A.program = O->program; -#if 0 - A.codegen = O->codegen; -#endif A.vartable = O->vartable; _slang_reset_error(); @@ -2115,12 +2103,6 @@ static const byte slang_vertex_builtin_gc[] = { #include "library/slang_vertex_builtin_gc.h" }; -#if 0 /*defined(USE_X86_ASM) || defined(SLANG_X86)*/ -static const byte slang_builtin_vec4_gc[] = { -#include "library/slang_builtin_vec4_gc.h" -}; -#endif - static GLboolean compile_object(grammar * id, const char *source, slang_code_object * object, slang_unit_type type, slang_info_log * infolog, @@ -2181,15 +2163,6 @@ compile_object(grammar * id, const char *source, slang_code_object * object, return GL_FALSE; } -#if 0/*defined(USE_X86_ASM) || defined(SLANG_X86)*/ - /* compile x86 4-component vector overrides, link to target */ - if (!compile_binary(slang_builtin_vec4_gc, - &object->builtin[SLANG_BUILTIN_VEC4], - slang_unit_fragment_builtin, infolog, NULL, - &object->builtin[SLANG_BUILTIN_TARGET])) - return GL_FALSE; -#endif - /* disable language extensions */ #if NEW_SLANG /* allow-built-ins */ grammar_set_reg8(*id, (const byte *) "parsing_builtin", 1); @@ -2205,24 +2178,6 @@ compile_object(grammar * id, const char *source, slang_code_object * object, } -#if 0 -static void -slang_create_uniforms(const slang_export_data_table *exports, - struct gl_program *program) -{ - /* XXX only add uniforms that are actually going to get used */ - GLuint i; - for (i = 0; i < exports->count; i++) { - if (exports->entries[i].access == slang_exp_uniform) { - const char *name = (char *) exports->entries[i].quant.name; - GLint j = _mesa_add_uniform(program->Parameters, name, 4); - assert(j >= 0); - } - } -} -#endif - - static GLboolean compile_shader(GLcontext *ctx, slang_code_object * object, slang_unit_type type, slang_info_log * infolog, @@ -2243,12 +2198,6 @@ compile_shader(GLcontext *ctx, slang_code_object * object, if (!success) return GL_FALSE; - if (!_slang_build_export_data_table(&object->expdata, &object->unit.vars)) - return GL_FALSE; - if (!_slang_build_export_code_table(&object->expcode, &object->unit.funs, - &object->unit)) - return GL_FALSE; - #if NEW_SLANG { slang_create_uniforms(&object->expdata, shader); diff --git a/src/mesa/shader/slang/slang_compile.h b/src/mesa/shader/slang/slang_compile.h index 450119d650d..3ebe72eca4a 100644 --- a/src/mesa/shader/slang/slang_compile.h +++ b/src/mesa/shader/slang/slang_compile.h @@ -27,7 +27,6 @@ #include "imports.h" #include "mtypes.h" -#include "slang_export.h" #include "slang_assemble.h" #include "slang_compile_variable.h" #include "slang_compile_struct.h" @@ -70,12 +69,7 @@ _slang_code_unit_dtr (slang_code_unit *); #define SLANG_BUILTIN_COMMON 1 #define SLANG_BUILTIN_TARGET 2 -#if 0/*defined(USE_X86_ASM) || defined(SLANG_X86)*/ -#define SLANG_BUILTIN_VEC4 3 -#define SLANG_BUILTIN_TOTAL 4 -#else #define SLANG_BUILTIN_TOTAL 3 -#endif typedef struct slang_code_object_ { @@ -84,8 +78,6 @@ typedef struct slang_code_object_ slang_assembly_file assembly; slang_var_pool varpool; slang_atom_pool atompool; - slang_export_data_table expdata; - slang_export_code_table expcode; } slang_code_object; extern GLvoid diff --git a/src/mesa/shader/slang/slang_compile_function.c b/src/mesa/shader/slang/slang_compile_function.c index c9b33f3b2fa..00a85c2e7de 100644 --- a/src/mesa/shader/slang/slang_compile_function.c +++ b/src/mesa/shader/slang/slang_compile_function.c @@ -214,49 +214,3 @@ slang_function_scope_find(slang_function_scope * funcs, slang_function * fun, return slang_function_scope_find(funcs->outer_scope, fun, 1); return NULL; } - -/* - * _slang_build_export_code_table() - */ - -GLboolean -_slang_build_export_code_table(slang_export_code_table * tbl, - slang_function_scope * funs, - slang_code_unit * unit) -{ - slang_atom mainAtom; - GLuint i; - - mainAtom = slang_atom_pool_atom(tbl->atoms, "main"); - if (mainAtom == SLANG_ATOM_NULL) - return GL_FALSE; - - for (i = 0; i < funs->num_functions; i++) { - if (funs->functions[i].header.a_name == mainAtom) { - slang_function *fun = &funs->functions[i]; - slang_export_code_entry *e; - slang_assemble_ctx A; - - e = slang_export_code_table_add(tbl); - if (e == NULL) - return GL_FALSE; - e->address = unit->object->assembly.count; - e->name = slang_atom_pool_atom(tbl->atoms, "@main"); - if (e->name == SLANG_ATOM_NULL) - return GL_FALSE; - - A.file = &unit->object->assembly; - A.atoms = &unit->object->atompool; - A.space.funcs = &unit->funs; - A.space.structs = &unit->structs; - A.space.vars = &unit->vars; - slang_assembly_file_push_label(&unit->object->assembly, - slang_asm_local_alloc, 20); - slang_assembly_file_push_label(&unit->object->assembly, - slang_asm_enter, 20); - _slang_assemble_function_call(&A, fun, NULL, 0, GL_FALSE); - slang_assembly_file_push(&unit->object->assembly, slang_asm_exit); - } - } - return GL_TRUE; -} diff --git a/src/mesa/shader/slang/slang_compile_function.h b/src/mesa/shader/slang/slang_compile_function.h index 8f0e3b326d4..99a6b2a0349 100644 --- a/src/mesa/shader/slang/slang_compile_function.h +++ b/src/mesa/shader/slang/slang_compile_function.h @@ -102,12 +102,6 @@ slang_function_scope_find_by_name(slang_function_scope *, slang_atom, int); extern slang_function * slang_function_scope_find(slang_function_scope *, slang_function *, int); -extern GLboolean -_slang_build_export_code_table(slang_export_code_table *, - slang_function_scope *, - struct slang_code_unit_ *); - - #ifdef __cplusplus } #endif diff --git a/src/mesa/shader/slang/slang_compile_variable.c b/src/mesa/shader/slang/slang_compile_variable.c index b19615b0850..c8ffaf296af 100644 --- a/src/mesa/shader/slang/slang_compile_variable.c +++ b/src/mesa/shader/slang/slang_compile_variable.c @@ -383,70 +383,3 @@ gl_type_from_specifier(const slang_type_specifier * type) return GL_FLOAT; } } - -static GLboolean -build_quant(slang_export_data_quant * q, const slang_variable * var) -{ - const slang_type_specifier *spec = &var->type.specifier; - - q->name = var->a_name; - q->size = var->size; - if (spec->type == slang_spec_array) { - q->array_len = var->array_len; -#if 1 - if (var->array_len > 0) -#endif - q->size /= var->array_len; - spec = spec->_array; - } - if (spec->type == slang_spec_struct) { - GLuint i; - - q->u.field_count = spec->_struct->fields->num_variables; - q->structure = (slang_export_data_quant *) - slang_alloc_malloc(q->u.field_count - * sizeof(slang_export_data_quant)); - if (q->structure == NULL) - return GL_FALSE; - - for (i = 0; i < q->u.field_count; i++) - slang_export_data_quant_ctr(&q->structure[i]); - for (i = 0; i < q->u.field_count; i++) { - if (!build_quant(&q->structure[i], - spec->_struct->fields->variables[i])) - return GL_FALSE; - } - } - else - q->u.basic_type = gl_type_from_specifier(spec); - return GL_TRUE; -} - -GLboolean -_slang_build_export_data_table(slang_export_data_table * tbl, - slang_variable_scope * vars) -{ - GLuint i; - - for (i = 0; i < vars->num_variables; i++) { - const slang_variable *var = vars->variables[i]; - slang_export_data_entry *e; - - e = slang_export_data_table_add(tbl); - if (e == NULL) - return GL_FALSE; - if (!build_quant(&e->quant, var)) - return GL_FALSE; - if (var->type.qualifier == slang_qual_uniform) - e->access = slang_exp_uniform; - else if (var->type.qualifier == slang_qual_attribute) - e->access = slang_exp_attribute; - else - e->access = slang_exp_varying; - e->address = var->address; - } - - if (vars->outer_scope != NULL) - return _slang_build_export_data_table(tbl, vars->outer_scope); - return GL_TRUE; -} diff --git a/src/mesa/shader/slang/slang_compile_variable.h b/src/mesa/shader/slang/slang_compile_variable.h index 82800b32b53..841f9840a63 100644 --- a/src/mesa/shader/slang/slang_compile_variable.h +++ b/src/mesa/shader/slang/slang_compile_variable.h @@ -126,11 +126,6 @@ extern slang_variable * _slang_locate_variable(const slang_variable_scope *, const slang_atom a_name, GLboolean all); -extern GLboolean -_slang_build_export_data_table(slang_export_data_table *, - slang_variable_scope *); - - #ifdef __cplusplus } diff --git a/src/mesa/shader/slang/slang_storage.c b/src/mesa/shader/slang/slang_storage.c index 899c36cbd3c..472d08e6c17 100644 --- a/src/mesa/shader/slang/slang_storage.c +++ b/src/mesa/shader/slang/slang_storage.c @@ -180,21 +180,13 @@ _slang_aggregate_variable(slang_storage_aggregate * agg, case slang_spec_vec3: return aggregate_vector(agg, slang_stor_float, 3); case slang_spec_vec4: -#if 0 /*defined(USE_X86_ASM) || defined(SLANG_X86) */ - return aggregate_vector(agg, slang_stor_vec4, 1); -#else return aggregate_vector(agg, slang_stor_float, 4); -#endif case slang_spec_mat2: return aggregate_matrix(agg, slang_stor_float, 2); case slang_spec_mat3: return aggregate_matrix(agg, slang_stor_float, 3); case slang_spec_mat4: -#if 0 /*defined(USE_X86_ASM) || defined(SLANG_X86) */ - return aggregate_vector(agg, slang_stor_vec4, 4); -#else return aggregate_matrix(agg, slang_stor_float, 4); -#endif case slang_spec_sampler1D: case slang_spec_sampler2D: case slang_spec_sampler3D: |