zink: fix tess shader i/o variables

this was a mismerge during refactoring for review

Fixes: d09f9da4c4 ("zink: add ntv handling for tess shader i/o variables")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8232>
This commit is contained in:
Mike Blumenkrantz 2020-12-24 17:14:14 -05:00 committed by Marge Bot
parent b9c2a0b4c6
commit aec03553e1
1 changed files with 5 additions and 4 deletions

View File

@ -309,12 +309,13 @@ handle_slot(struct ntv_context *ctx, unsigned slot)
static inline unsigned
handle_handle_slot(struct ntv_context *ctx, struct nir_variable *var)
handle_handle_slot(struct ntv_context *ctx, struct nir_variable *var, bool output)
{
if (var->data.patch) {
assert(var->data.location >= VARYING_SLOT_PATCH0);
return var->data.location - VARYING_SLOT_PATCH0;
} else if (ctx->stage == MESA_SHADER_TESS_CTRL) {
} else if ((output && ctx->stage == MESA_SHADER_TESS_CTRL) ||
(!output && ctx->stage == MESA_SHADER_TESS_EVAL)) {
assert(var->data.location >= VARYING_SLOT_VAR0);
return var->data.location - VARYING_SLOT_VAR0;
}
@ -383,7 +384,7 @@ emit_input(struct ntv_context *ctx, struct nir_variable *var)
break;
default:
slot = handle_handle_slot(ctx, var);
slot = handle_handle_slot(ctx, var, false);
spirv_builder_emit_location(&ctx->builder, var_id, slot);
}
}
@ -442,7 +443,7 @@ emit_output(struct ntv_context *ctx, struct nir_variable *var)
break;
default:
slot = handle_handle_slot(ctx, var);
slot = handle_handle_slot(ctx, var, true);
spirv_builder_emit_location(&ctx->builder, var_id, slot);
}
/* tcs can't do xfb */