From 5aa3748b26a810c29ffb0daa518a75d17496d7f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 5 Jul 2025 03:54:27 -0400 Subject: [PATCH] nir: remove deprecated nir_io_dont_optimize Reviewed-by: Alyssa Rosenzweig Part-of: --- src/compiler/glsl/gl_nir_linker.c | 8 +++----- src/compiler/nir/nir_shader_compiler_options.h | 10 +--------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/compiler/glsl/gl_nir_linker.c b/src/compiler/glsl/gl_nir_linker.c index 3b0d79c23d0..07b02d586b4 100644 --- a/src/compiler/glsl/gl_nir_linker.c +++ b/src/compiler/glsl/gl_nir_linker.c @@ -1470,7 +1470,9 @@ gl_nir_lower_optimize_varyings(const struct gl_constants *consts, unsigned num_shaders = 0; unsigned max_ubos = UINT_MAX; unsigned max_uniform_comps = UINT_MAX; - bool optimize_io = !debug_get_bool_option("MESA_GLSL_DISABLE_IO_OPT", false); + + if (debug_get_bool_option("MESA_GLSL_DISABLE_IO_OPT", false)) + return; for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { struct gl_linked_shader *shader = prog->_LinkedShaders[i]; @@ -1488,16 +1490,12 @@ gl_nir_lower_optimize_varyings(const struct gl_constants *consts, consts->Program[i].MaxUniformComponents); max_ubos = MIN2(max_ubos, consts->Program[i].MaxUniformBlocks); num_shaders++; - optimize_io &= !(nir->options->io_options & nir_io_dont_optimize); } /* Lower IO derefs to load and store intrinsics. */ for (unsigned i = 0; i < num_shaders; i++) nir_lower_io_passes(shaders[i], true); - if (!optimize_io) - return; - /* There is nothing to optimize for only 1 shader. */ if (num_shaders == 1) { nir_shader *nir = shaders[0]; diff --git a/src/compiler/nir/nir_shader_compiler_options.h b/src/compiler/nir/nir_shader_compiler_options.h index fc8b984e078..7aa0724586d 100644 --- a/src/compiler/nir/nir_shader_compiler_options.h +++ b/src/compiler/nir/nir_shader_compiler_options.h @@ -195,14 +195,6 @@ typedef enum { */ nir_io_has_intrinsics = BITFIELD_BIT(16), - /** - * Don't run nir_opt_varyings and nir_opt_vectorize_io. - * - * This option is deprecated and is a hack. DO NOT USE. - * Use MESA_GLSL_DISABLE_IO_OPT=1 instead. - */ - nir_io_dont_optimize = BITFIELD_BIT(17), - /** * Whether clip and cull distance arrays should be separate. If this is not * set, cull distances will be moved into VARYING_SLOT_CLIP_DISTn after clip @@ -210,7 +202,7 @@ typedef enum { * of the first cull distance. nir_lower_clip_cull_distance_array_vars does * that. */ - nir_io_separate_clip_cull_distance_arrays = BITFIELD_BIT(18), + nir_io_separate_clip_cull_distance_arrays = BITFIELD_BIT(17), } nir_io_options; typedef enum {