diff --git a/src/intel/compiler/brw/brw_nir.c b/src/intel/compiler/brw/brw_nir.c index 51cb8d87679..7c11c411dbe 100644 --- a/src/intel/compiler/brw/brw_nir.c +++ b/src/intel/compiler/brw/brw_nir.c @@ -2186,7 +2186,11 @@ brw_postprocess_nir_opts(nir_shader *nir, const struct brw_compiler *compiler, if (OPT(nir_lower_tex, &tex_options)) OPT(nir_lower_tex, &tex_options); - OPT(brw_nir_lower_mcs_fetch, devinfo); + /* MCS lowering can introduce u2u16 conversions. We need to lower those to + * make constant offsets detectable by brw_nir_texture_backend_opcode(). + */ + if (OPT(brw_nir_lower_mcs_fetch, devinfo)) + OPT(nir_opt_constant_folding); OPT(intel_nir_lower_sparse_intrinsics);