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;
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;
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
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();
}
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;
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;
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);
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))
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 */
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 */
#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);
#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);
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;
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;
#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;
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;
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))
#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;
}
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;
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;
if (!initialize_global(&A, var))
return 0;
}
- else {
- _mesa_memset((GLubyte *) (O->machine->mem) + var->address, 0,
- var->size);
- }
}
return 1;
}
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;
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);
#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"
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;
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;
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++)
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;
}
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;
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;
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;
}
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) {
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;
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 */
#include "slang_compile.h"
#include "slang_assemble.h"
-#include "slang_execute.h"
#if defined __cplusplus
extern "C" {
slang_function_scope *funcs,
slang_struct_scope *structs,
slang_variable_scope *vars,
- slang_machine *mach,
slang_assembly_file *file,
slang_atom_pool *atoms);