Remove all dependencies on the old slang interpreter/executor.
authorBrian <brian@yutani.localnet.net>
Fri, 2 Feb 2007 20:49:07 +0000 (13:49 -0700)
committerBrian <brian@yutani.localnet.net>
Fri, 2 Feb 2007 20:49:07 +0000 (13:49 -0700)
src/mesa/shader/slang/slang_assemble.c
src/mesa/shader/slang/slang_assemble.h
src/mesa/shader/slang/slang_assemble_assignment.c
src/mesa/shader/slang/slang_assemble_constructor.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_link.c
src/mesa/shader/slang/slang_link.h
src/mesa/shader/slang/slang_storage.c
src/mesa/shader/slang/slang_storage.h

index 27249078b3762d0c5b28ad1b5c8f17bfd8969170..e3b65a12383e8007924d5142af8e316ba33a514a 100644 (file)
@@ -185,7 +185,7 @@ sizeof_variable(const slang_assemble_ctx * A, slang_type_specifier * spec,
    if (!slang_storage_aggregate_construct(&agg))
       return GL_FALSE;
    if (!_slang_aggregate_variable(&agg, spec, array_len, A->space.funcs,
-                                  A->space.structs, A->space.vars, A->mach,
+                                  A->space.structs, A->space.vars,
                                   A->file, A->atoms)) {
       slang_storage_aggregate_destruct(&agg);
       return GL_FALSE;
@@ -551,7 +551,7 @@ _slang_dereference(slang_assemble_ctx * A, slang_operation * op)
    if (!slang_storage_aggregate_construct(&agg))
       goto end1;
    if (!_slang_aggregate_variable(&agg, &ti.spec, ti.array_len, A->space.funcs,
-                                  A->space.structs, A->space.vars, A->mach,
+                                  A->space.structs, A->space.vars,
                                   A->file, A->atoms))
       goto end;
 
@@ -871,7 +871,7 @@ equality(slang_assemble_ctx * A, slang_operation * op, GLboolean equal)
       goto end1;
    if (!_slang_aggregate_variable(&agg, &ti.spec, 0, A->space.funcs,
                                   A->space.structs, A->space.vars,
-                                  A->mach, A->file, A->atoms))
+                                  A->file, A->atoms))
       goto end;
 
    /* compute the size of the agregate - there are two such aggregates
@@ -1094,7 +1094,7 @@ handle_field(slang_assemble_ctx * A, slang_assembly_typeinfo * tia,
          if (!_slang_aggregate_variable(&agg, &field->type.specifier,
                                         field->array_len, A->space.funcs,
                                         A->space.structs, A->space.vars,
-                                        A->mach, A->file, A->atoms)) {
+                                        A->file, A->atoms)) {
             slang_storage_aggregate_destruct(&agg);
             RETURN_NIL();
          }
index 4f1512afca7f2cfad53b565a64942e2be6f87d8a..7e380b3c3340d4b6c451fd21ca9b6af65fd5526f 100644 (file)
@@ -247,7 +247,6 @@ typedef struct slang_assembly_name_space_
 typedef struct slang_assemble_ctx_
 {
    slang_assembly_file *file;
-   struct slang_machine_ *mach;
    slang_atom_pool *atoms;
    slang_assembly_name_space space;
    slang_assembly_flow_control flow;
index bfce04ec885db92bea6e068fc7929ebba2212a66..93a1ef3a081423e34afca6808f1da903a6ea9f2d 100644 (file)
@@ -164,7 +164,7 @@ _slang_assemble_assignment(slang_assemble_ctx * A, const slang_operation * op)
       goto end1;
    if (!_slang_aggregate_variable(&agg, &ti.spec, 0, A->space.funcs,
                                   A->space.structs, A->space.vars,
-                                  A->mach, A->file, A->atoms))
+                                  A->file, A->atoms))
       goto end;
 
    index = 0;
index e045f2f6d2eb0e75df0c33f716b8d560483f1c57..63407580caf396e36af64dd7c3bb6ab3199af2e3 100644 (file)
@@ -182,7 +182,7 @@ sizeof_argument(slang_assemble_ctx * A, GLuint * size, slang_operation * op)
       goto end1;
    if (!_slang_aggregate_variable(&agg, &ti.spec, 0, A->space.funcs,
                                   A->space.structs, A->space.vars,
-                                  A->mach, A->file, A->atoms))
+                                  A->file, A->atoms))
       goto end;
 
    *size = _slang_sizeof_aggregate(&agg);
@@ -214,7 +214,7 @@ constructor_aggregate(slang_assemble_ctx * A,
       goto end1;
    if (!_slang_aggregate_variable(&agg, &ti.spec, 0, A->space.funcs,
                                   A->space.structs, A->space.vars,
-                                  A->mach, A->file, A->atoms))
+                                  A->file, A->atoms))
       goto end2;
 
    if (!slang_storage_aggregate_construct(&flat_agg))
@@ -276,7 +276,7 @@ _slang_assemble_constructor(slang_assemble_ctx * A, const slang_operation * op)
       goto end1;
    if (!_slang_aggregate_variable(&agg, &ti.spec, 0, A->space.funcs,
                                   A->space.structs, A->space.vars,
-                                  A->mach, A->file, A->atoms))
+                                  A->file, A->atoms))
       goto end2;
 
    /* calculate size of the constructor */
@@ -316,7 +316,7 @@ _slang_assemble_constructor(slang_assemble_ctx * A, const slang_operation * op)
             goto end1;
          if (!_slang_aggregate_variable(&agg, &ti.spec, 0, A->space.funcs,
                                         A->space.structs, A->space.vars,
-                                        A->mach, A->file, A->atoms))
+                                        A->file, A->atoms))
             goto end2;
          
          /* calculate size of the constructor */
index 4203c3cc6f2dcfee190f33924fb7b5ba015f0838..8148c65a55d7eed0cda7d3342632639ebb823d33 100644 (file)
@@ -103,7 +103,6 @@ _slang_code_object_ctr(slang_code_object * self)
 #if 01
    _slang_assembly_file_ctr(&self->assembly);
 #endif
-   slang_machine_ctr(&self->machine);
    self->varpool.next_addr = 0;
    slang_atom_pool_construct(&self->atompool);
    slang_export_data_table_ctr(&self->expdata);
@@ -123,7 +122,6 @@ _slang_code_object_dtr(slang_code_object * self)
 #if 01
    slang_assembly_file_destruct(&self->assembly);
 #endif
-   slang_machine_dtr(&self->machine);
    slang_atom_pool_destruct(&self->atompool);
    slang_export_data_table_dtr(&self->expdata);
    slang_export_code_table_ctr(&self->expcode);
@@ -252,7 +250,6 @@ typedef struct slang_output_ctx_
    slang_struct_scope *structs;
    slang_assembly_file *assembly;
    slang_var_pool *global_pool;
-   slang_machine *machine;
    struct gl_program *program;
    slang_var_table *vartable;
 } slang_output_ctx;
@@ -386,7 +383,7 @@ calculate_var_size(slang_parse_ctx * C, slang_output_ctx * O,
    if (!slang_storage_aggregate_construct(&agg))
       return GL_FALSE;
    if (!_slang_aggregate_variable(&agg, &var->type.specifier, var->array_len,
-                                  O->funs, O->structs, O->vars, O->machine,
+                                  O->funs, O->structs, O->vars,
                                   O->assembly, C->atoms)) {
       slang_storage_aggregate_destruct(&agg);
       return GL_FALSE;
@@ -1556,7 +1553,6 @@ initialize_global(slang_assemble_ctx * A, slang_variable * var)
 #if 01
    slang_assembly_file_restore_point point;
 #endif
-   slang_machine mach;
    slang_assembly_local_info save_local = A->local;
    slang_operation op_id, op_assign;
    GLboolean result;
@@ -1567,10 +1563,6 @@ initialize_global(slang_assemble_ctx * A, slang_variable * var)
       return GL_FALSE;
 #endif
 
-   /* setup the machine */
-   mach = *A->mach;
-   mach.ip = A->file->count;
-
    /* allocate local storage for expression */
    A->local.ret_size = 0;
    A->local.addr_tmp = 0;
@@ -1635,12 +1627,6 @@ initialize_global(slang_assemble_ctx * A, slang_variable * var)
    if (!slang_assembly_file_push(A->file, slang_asm_exit))
       return GL_FALSE;
 
-   /* execute the expression */
-#if 0
-   if (!_slang_execute2(A->file, &mach))
-      return GL_FALSE;
-#endif
-
 #if 01
    /* restore the old assembly */
    if (!slang_assembly_file_restore_point_load(A->file, &point))
@@ -1648,10 +1634,6 @@ initialize_global(slang_assemble_ctx * A, slang_variable * var)
 #endif
    A->local = save_local;
 
-   /* now we copy the contents of the initialized variable back to the original machine */
-   _mesa_memcpy((GLubyte *) A->mach->mem + var->address,
-                (GLubyte *) mach.mem + var->address, var->size);
-
    return GL_TRUE;
 }
 
@@ -1743,7 +1725,6 @@ parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O,
       slang_assemble_ctx A;
 
       A.file = O->assembly;
-      A.mach = O->machine;
       A.atoms = C->atoms;
       A.space.funcs = O->funs;
       A.space.structs = O->structs;
@@ -1773,7 +1754,6 @@ parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O,
          slang_assemble_ctx A;
 
          A.file = O->assembly;
-         A.mach = O->machine;
          A.atoms = C->atoms;
          A.space.funcs = O->funs;
          A.space.structs = O->structs;
@@ -1781,10 +1761,6 @@ parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O,
          if (!initialize_global(&A, var))
             return 0;
       }
-      else {
-         _mesa_memset((GLubyte *) (O->machine->mem) + var->address, 0,
-                      var->size);
-      }
    }
    return 1;
 }
@@ -1909,7 +1885,6 @@ parse_function(slang_parse_ctx * C, slang_output_ctx * O, int definition,
       slang_assemble_ctx A;
 
       A.file = O->assembly;
-      A.mach = O->machine;
       A.atoms = C->atoms;
       A.space.funcs = O->funs;
       A.space.structs = O->structs;
@@ -2003,7 +1978,6 @@ parse_code_unit(slang_parse_ctx * C, slang_code_unit * unit,
    o.vars = &unit->vars;
    o.assembly = &unit->object->assembly;
    o.global_pool = &unit->object->varpool;
-   o.machine = &unit->object->machine;
    o.program = program;
    o.vartable = _slang_new_var_table(maxRegs);
    _slang_push_var_table(o.vartable);
index a8311e854652e250b2c4a854d2de962a02d3021f..450119d650d4b8d006fd37ca83dbb1430a22e167 100644 (file)
@@ -28,7 +28,7 @@
 #include "imports.h"
 #include "mtypes.h"
 #include "slang_export.h"
-#include "slang_execute.h"
+#include "slang_assemble.h"
 #include "slang_compile_variable.h"
 #include "slang_compile_struct.h"
 #include "slang_compile_operation.h"
@@ -82,7 +82,6 @@ typedef struct slang_code_object_
    slang_code_unit builtin[SLANG_BUILTIN_TOTAL];
    slang_code_unit unit;
    slang_assembly_file assembly;
-   slang_machine machine;
    slang_var_pool varpool;
    slang_atom_pool atompool;
    slang_export_data_table expdata;
index 3642b12e92af6ca841bf0731b1b59a95cfe6a281..c9b33f3b2fa8622f0c913ea7f15ffe17f3740375 100644 (file)
@@ -246,7 +246,6 @@ _slang_build_export_code_table(slang_export_code_table * tbl,
             return GL_FALSE;
 
          A.file = &unit->object->assembly;
-         A.mach = &unit->object->machine;
          A.atoms = &unit->object->atompool;
          A.space.funcs = &unit->funs;
          A.space.structs = &unit->structs;
index 008b7ab36996fe8524157aa287a85bd5d759a4ea..8894f78088d912b21e4065bf9bf115a1cca08984 100644 (file)
@@ -646,7 +646,6 @@ _slang_program_ctr (slang_program *self)
          self->common_fixed_entries[i][j] = ~0;
       for (j = 0; j < SLANG_COMMON_CODE_MAX; j++)
          self->code[i][j] = ~0;
-      self->machines[i] = NULL;
       self->assemblies[i] = NULL;
    }
    for (i = 0; i < SLANG_VERTEX_FIXED_MAX; i++)
@@ -859,7 +858,6 @@ _slang_link (slang_program *prog, slang_code_object **objects, GLuint count)
          return GL_FALSE;
       resolve_common_fixed (prog->common_fixed_entries[index], &objects[i]->expdata);
       resolve_common_code (prog->code[index], &objects[i]->expcode);
-      prog->machines[index] = &objects[i]->machine;
       prog->assemblies[index] = &objects[i]->assembly;
    }
 
index d9819289cace8e219dcb8a12d0f983234416ac54..8c7d0c01cf56f416108ad40fdaaf7993059a3777 100644 (file)
@@ -332,7 +332,6 @@ typedef struct
    GLuint vertex_fixed_entries[SLANG_VERTEX_FIXED_MAX];
    GLuint fragment_fixed_entries[SLANG_FRAGMENT_FIXED_MAX];
    GLuint code[SLANG_SHADER_MAX][SLANG_COMMON_CODE_MAX];
-   slang_machine *machines[SLANG_SHADER_MAX];
    slang_assembly_file *assemblies[SLANG_SHADER_MAX];
 } slang_program;
 
index 81969757660ed31d4cd27d33139c6695a46b805b..899c36cbd3c4de8a276d796bd37c0c1d18df22e2 100644 (file)
@@ -135,7 +135,7 @@ static GLboolean
 aggregate_variables(slang_storage_aggregate * agg,
                     slang_variable_scope * vars, slang_function_scope * funcs,
                     slang_struct_scope * structs,
-                    slang_variable_scope * globals, slang_machine * mach,
+                    slang_variable_scope * globals,
                     slang_assembly_file * file, slang_atom_pool * atoms)
 {
    GLuint i;
@@ -143,7 +143,7 @@ aggregate_variables(slang_storage_aggregate * agg,
    for (i = 0; i < vars->num_variables; i++)
       if (!_slang_aggregate_variable(agg, &vars->variables[i]->type.specifier,
                                      vars->variables[i]->array_len, funcs,
-                                     structs, globals, mach, file, atoms))
+                                     structs, globals, file, atoms))
          return GL_FALSE;
    return GL_TRUE;
 }
@@ -153,7 +153,7 @@ _slang_aggregate_variable(slang_storage_aggregate * agg,
                           slang_type_specifier * spec, GLuint array_len,
                           slang_function_scope * funcs,
                           slang_struct_scope * structs,
-                          slang_variable_scope * vars, slang_machine * mach,
+                          slang_variable_scope * vars,
                           slang_assembly_file * file, slang_atom_pool * atoms)
 {
    switch (spec->type) {
@@ -204,7 +204,7 @@ _slang_aggregate_variable(slang_storage_aggregate * agg,
       return aggregate_vector(agg, slang_stor_int, 1);
    case slang_spec_struct:
       return aggregate_variables(agg, spec->_struct->fields, funcs, structs,
-                                 vars, mach, file, atoms);
+                                 vars, file, atoms);
    case slang_spec_array:
       {
          slang_storage_array *arr;
@@ -223,9 +223,8 @@ _slang_aggregate_variable(slang_storage_aggregate * agg,
             arr->aggregate = NULL;
             return GL_FALSE;
          }
-         if (!_slang_aggregate_variable
-             (arr->aggregate, spec->_array, 0, funcs, structs, vars, mach,
-              file, atoms))
+         if (!_slang_aggregate_variable(arr->aggregate, spec->_array, 0,
+                                        funcs, structs, vars, file, atoms))
             return GL_FALSE;
          arr->length = array_len;
          /* TODO: check if 0 < arr->length <= 65535 */
index 0137003a9d5ee463cdce7206d091691c110cf7f5..3fe60c78fec5a1256ebdb60c06aefa5ab60fccf5 100644 (file)
@@ -27,7 +27,6 @@
 
 #include "slang_compile.h"
 #include "slang_assemble.h"
-#include "slang_execute.h"
 
 #if defined __cplusplus
 extern "C" {
@@ -99,7 +98,6 @@ _slang_aggregate_variable(slang_storage_aggregate *agg,
                           slang_function_scope *funcs,
                           slang_struct_scope *structs,
                           slang_variable_scope *vars,
-                          slang_machine *mach,
                           slang_assembly_file *file,
                           slang_atom_pool *atoms);