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); }