From d8f1cf49465c0e003302f1c4c0595118a35037d4 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Tue, 23 Jul 2019 17:55:51 +0200 Subject: [PATCH] zink/spirv: alias var0 on tex0 etc instead This fixes Quake3, and is more in line with directx semantics. Acked-by: Jordan Justen --- src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c index 96f1f543321..73b817bf4d4 100644 --- a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c +++ b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c @@ -235,7 +235,9 @@ emit_input(struct ntv_context *ctx, struct nir_variable *var) if (ctx->stage == MESA_SHADER_FRAGMENT) { if (var->data.location >= VARYING_SLOT_VAR0) spirv_builder_emit_location(&ctx->builder, var_id, - var->data.location - VARYING_SLOT_VAR0); + var->data.location - + VARYING_SLOT_VAR0 + + VARYING_SLOT_TEX0); else if ((var->data.location >= VARYING_SLOT_COL0 && var->data.location <= VARYING_SLOT_TEX7) || var->data.location == VARYING_SLOT_BFC0 || @@ -291,7 +293,9 @@ emit_output(struct ntv_context *ctx, struct nir_variable *var) if (ctx->stage == MESA_SHADER_VERTEX) { if (var->data.location >= VARYING_SLOT_VAR0) spirv_builder_emit_location(&ctx->builder, var_id, - var->data.location - VARYING_SLOT_VAR0); + var->data.location - + VARYING_SLOT_VAR0 + + VARYING_SLOT_TEX0); else if ((var->data.location >= VARYING_SLOT_COL0 && var->data.location <= VARYING_SLOT_TEX7) || var->data.location == VARYING_SLOT_BFC0 || -- 2.30.2