remove slang_export.c and related code
authorBrian <brian@yutani.localnet.net>
Fri, 2 Feb 2007 21:24:24 +0000 (14:24 -0700)
committerBrian <brian@yutani.localnet.net>
Fri, 2 Feb 2007 21:24:24 +0000 (14:24 -0700)
src/mesa/shader/slang/slang_assemble.c
src/mesa/shader/slang/slang_assemble_assignment.c
src/mesa/shader/slang/slang_compile.c
src/mesa/shader/slang/slang_compile.h
src/mesa/shader/slang/slang_compile_function.c
src/mesa/shader/slang/slang_compile_function.h
src/mesa/shader/slang/slang_compile_variable.c
src/mesa/shader/slang/slang_compile_variable.h
src/mesa/shader/slang/slang_storage.c
src/mesa/sources

index e3b65a12383e8007924d5142af8e316ba33a514a..e65bf38ad518b4713302729cea3540d9f4557821 100644 (file)
@@ -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;
index 93a1ef3a081423e34afca6808f1da903a6ea9f2d..6efc0f558a08a8f7334bb766f94a45e97336ff40 100644 (file)
@@ -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;
index 8148c65a55d7eed0cda7d3342632639ebb823d33..9f7f18167d861868f6b0476c6c17fe81201c44ef 100644 (file)
@@ -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);
index 450119d650d4b8d006fd37ca83dbb1430a22e167..3ebe72eca4ab11dc3224af9fc8a70121519e1980 100644 (file)
@@ -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
index c9b33f3b2fa8622f0c913ea7f15ffe17f3740375..00a85c2e7de6c548125eb4bbd606cc5befa58dc5 100644 (file)
@@ -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;
-}
index 8f0e3b326d43743953112fec7c9b55abcc23e5a6..99a6b2a0349867e6edf3f3be091259a9c7bc178d 100644 (file)
@@ -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
index b19615b0850a9200584b259c83c777bf56a7d825..c8ffaf296afaf679e7d80da851934ba2deaccfd2 100644 (file)
@@ -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;
-}
index 82800b32b53ed6e0446042677c58405b652eb3f8..841f9840a635fe2a742519755c1672b469f473b5 100644 (file)
@@ -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
 }
index 899c36cbd3c4de8a276d796bd37c0c1d18df22e2..472d08e6c17308bd223b03906ca3e95495214c8f 100644 (file)
@@ -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:
index a7936101cae9f4baa3b88d65ec5ed6ce361c31ce..9b77d2178694a83668f5de131a5d98cb9639791a 100644 (file)
@@ -179,7 +179,6 @@ SLANG_SOURCES =     \
        shader/slang/slang_compile_variable.c   \
        shader/slang/slang_emit.c       \
        shader/slang/slang_error.c      \
-       shader/slang/slang_export.c     \
        shader/slang/slang_library_noise.c      \
        shader/slang/slang_library_texsample.c  \
        shader/slang/slang_link2.c      \