summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/slang/slang_emit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/shader/slang/slang_emit.c')
-rw-r--r--src/mesa/shader/slang/slang_emit.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c
index 0b4ef6dba10..29d9544ebe2 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;