diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 6818f408d60..16a4c16d0ee 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -4915,6 +4915,11 @@ typedef struct nir_lower_tex_options { */ bool lower_txd_3d; + /** + * If true, lower nir_texop_txd any array surfaces with nir_texop_txl. + */ + bool lower_txd_array; + /** * If true, lower nir_texop_txd on shadow samplers (except cube maps) * with nir_texop_txl. Notice that cube map shadow samplers are lowered diff --git a/src/compiler/nir/nir_lower_tex.c b/src/compiler/nir/nir_lower_tex.c index d6fd0265b51..7a42bb339e7 100644 --- a/src/compiler/nir/nir_lower_tex.c +++ b/src/compiler/nir/nir_lower_tex.c @@ -1455,7 +1455,8 @@ nir_lower_tex_block(nir_block *block, nir_builder *b, (options->lower_txd_cube_map && tex->sampler_dim == GLSL_SAMPLER_DIM_CUBE) || (options->lower_txd_3d && - tex->sampler_dim == GLSL_SAMPLER_DIM_3D))) { + tex->sampler_dim == GLSL_SAMPLER_DIM_3D) || + (options->lower_txd_array && tex->is_array))) { lower_gradient(b, tex); progress = true; continue; diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c index a1aee7f2c2a..9af4201e290 100644 --- a/src/intel/compiler/brw_nir.c +++ b/src/intel/compiler/brw_nir.c @@ -821,7 +821,8 @@ brw_preprocess_nir(const struct brw_compiler *compiler, nir_shader *nir, .lower_txf_offset = true, .lower_rect_offset = true, .lower_txd_cube_map = true, - .lower_txd_3d = devinfo->verx10 >= 125, + .lower_txd_3d = devinfo->verx10 >= 125, /* Wa_1209978020 */ + .lower_txd_array = devinfo->verx10 >= 125, /* Wa_1209978020 */ .lower_txb_shadow_clamp = true, .lower_txd_shadow_clamp = true, .lower_txd_offset_clamp = true,