From e3d122ed7b0ddde1cae137e84d9dba603ba58520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 2 Jun 2025 12:03:29 -0400 Subject: [PATCH] nir/opt_varyings: completely exclude mediump from type changes It broke mediump XFB, which needs the correct type for the up-conversion. Reviewed-by: Timothy Arceri Part-of: --- src/compiler/nir/nir_opt_varyings.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/compiler/nir/nir_opt_varyings.c b/src/compiler/nir/nir_opt_varyings.c index 5bbd1de3510..eda9e1ef7ca 100644 --- a/src/compiler/nir/nir_opt_varyings.c +++ b/src/compiler/nir/nir_opt_varyings.c @@ -4186,7 +4186,6 @@ relocate_slot(struct linkage_info *linkage, struct scalar_slot *slot, } nir_io_semantics sem = nir_intrinsic_io_semantics(intr); - unsigned bit_size = nir_intrinsic_infos[intr->intrinsic].has_dest ? intr->def.bit_size : intr->src[0].ssa->bit_size; /* Set all types to float to facilitate full IO vectorization. * This is skipped only if mediump is not lowered to 16 bits. @@ -4198,7 +4197,7 @@ relocate_slot(struct linkage_info *linkage, struct scalar_slot *slot, * Set nir_shader_compiler_options::lower_mediump_io if you want to * lower mediump to 16 bits in the GLSL linker before this pass. */ - if (bit_size != 32 || !sem.medium_precision) { + if (!sem.medium_precision) { nir_alu_type type = nir_intrinsic_has_src_type(intr) ? nir_intrinsic_src_type(intr) : nir_intrinsic_dest_type(intr); type = nir_alu_type_get_type_size(type) | nir_type_float;