From ef264c2971b43717c8f565f1d39f4149be3aaa85 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 14 Dec 2006 13:58:57 -0700 Subject: Assorted fix-ups for the new linker. Disable some of the excessive debug output. --- src/mesa/shader/slang/slang_codegen.c | 9 ++++++--- src/mesa/shader/slang/slang_emit.c | 12 ++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) (limited to 'src/mesa/shader/slang') diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index e428209ec4..40a27bc351 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -405,7 +405,7 @@ slang_substitute(slang_assemble_ctx *A, slang_operation *oper, /* OK, replace this slang_oper_identifier with a new expr */ assert(substNew[i]->type == slang_oper_identifier || substNew[i]->type == slang_oper_literal_float); -#if 1 /* DEBUG only */ +#if 0 /* DEBUG only */ if (substNew[i]->type == slang_oper_identifier) { assert(substNew[i]->var); assert(substNew[i]->var->a_name); @@ -730,7 +730,7 @@ slang_assemble_function_call(slang_assemble_ctx *A, slang_function *fun, #endif -#if 1 +#if 0 assert(inlined->locals); printf("*** Inlined code for call to %s:\n", (char*) fun->header.a_name); @@ -1231,8 +1231,9 @@ _slang_codegen_function(slang_assemble_ctx * A, slang_function * fun) return 0; printf("\n*********** Assemble function2(%s)\n", (char*)fun->header.a_name); - +#if 0 slang_print_function(fun, 1); +#endif A->program->Parameters = _mesa_new_parameter_list(); A->program->Varying = _mesa_new_parameter_list(); @@ -1254,11 +1255,13 @@ _slang_codegen_function(slang_assemble_ctx * A, slang_function * fun) CurFunction = NULL; +#if 0 printf("************* New body for %s *****\n", (char*)fun->header.a_name); slang_print_function(fun, 1); printf("************* IR for %s *******\n", (char*)fun->header.a_name); slang_print_ir(n, 0); +#endif if (_mesa_strcmp((char*) fun->header.a_name, "main") == 0) { _slang_emit_code(n, A->program); diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index 0b4ef6dba1..29d9544ebe 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -555,12 +555,20 @@ slang_alloc_varying(struct gl_program *prog, const char *name) { GLint i = _mesa_add_varying(prog->Varying, name, 4); /* XXX fix size */ if (prog->Target == GL_VERTEX_PROGRAM_ARB) { +#ifdef OLD_LINK i += VERT_RESULT_VAR0; prog->OutputsWritten |= (1 << i); +#else + prog->OutputsWritten |= (1 << (i + VERT_RESULT_VAR0)); +#endif } else { +#ifdef OLD_LINK i += FRAG_ATTRIB_VAR0; prog->InputsRead |= (1 << i); +#else + prog->InputsRead |= (1 << (i + FRAG_ATTRIB_VAR0)); +#endif } return i; } @@ -697,10 +705,14 @@ slang_resolve_storage(slang_gen_context *gc, slang_ir_node *n, else if (n->Var->type.qualifier == slang_qual_varying) { i = slang_alloc_varying(prog, (char *) n->Var->a_name); if (i >= 0) { +#ifdef OLD_LINK if (prog->Target == GL_VERTEX_PROGRAM_ARB) n->Store->File = PROGRAM_OUTPUT; else n->Store->File = PROGRAM_INPUT; +#else + n->Store->File = PROGRAM_VARYING; +#endif n->Store->Size = sizeof_type(&n->Var->type); n->Store->Index = i; return; -- cgit v1.2.3