From 3b289c9f30e91b329dc8e6d68053ee45b82ef9e9 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 2 Sep 2021 15:18:49 -0400 Subject: [PATCH] tgsi_to_nir: force int type for LAYER output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this otherwise gets confused as a vec4 most of the time Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Timur Kristóf Part-of: --- src/gallium/auxiliary/nir/tgsi_to_nir.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c index 7454c6d21da..156345deaac 100644 --- a/src/gallium/auxiliary/nir/tgsi_to_nir.c +++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c @@ -431,6 +431,8 @@ ttn_emit_declaration(struct ttn_compile *c) if (var->data.location == VARYING_SLOT_FOGC || var->data.location == VARYING_SLOT_PSIZ) { var->type = glsl_float_type(); + } else if (var->data.location == VARYING_SLOT_LAYER) { + var->type = glsl_int_type(); } } @@ -2219,8 +2221,9 @@ ttn_add_output_stores(struct ttn_compile *c) else if (var->data.location == FRAG_RESULT_SAMPLE_MASK) store_value = nir_channel(b, store_value, 0); } else { - /* FOGC and PSIZ are scalar values */ + /* FOGC, LAYER, and PSIZ are scalar values */ if (var->data.location == VARYING_SLOT_FOGC || + var->data.location == VARYING_SLOT_LAYER || var->data.location == VARYING_SLOT_PSIZ) { store_value = nir_channel(b, store_value, 0); }