/* 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);
#endif
-#if 1
+#if 0
assert(inlined->locals);
printf("*** Inlined code for call to %s:\n",
(char*) fun->header.a_name);
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();
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);
{
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;
}
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;