diff --git a/src/amd/common/ac_nir.h b/src/amd/common/ac_nir.h index 3f8585fc0e8..593054423b1 100644 --- a/src/amd/common/ac_nir.h +++ b/src/amd/common/ac_nir.h @@ -320,7 +320,7 @@ typedef struct { enum amd_gfx_level gfx_level; /* If true, round the layer component of the coordinates source to the nearest - * integer for all array ops. + * integer for all array ops. This is always done for cube array ops. */ bool lower_array_layer_round_even; diff --git a/src/amd/common/ac_nir_lower_tex.c b/src/amd/common/ac_nir_lower_tex.c index 3e4ec1a1012..faf307a9f1a 100644 --- a/src/amd/common/ac_nir_lower_tex.c +++ b/src/amd/common/ac_nir_lower_tex.c @@ -176,7 +176,8 @@ lower_tex_coords(nir_builder *b, nir_tex_instr *tex, nir_ssa_def **coords, const ac_nir_lower_tex_options *options) { bool progress = false; - if (options->lower_array_layer_round_even && tex->is_array && tex->op != nir_texop_lod) + if ((options->lower_array_layer_round_even || tex->sampler_dim == GLSL_SAMPLER_DIM_CUBE) && + tex->is_array && tex->op != nir_texop_lod) progress |= lower_array_layer_round_even(b, tex, coords); if (tex->sampler_dim != GLSL_SAMPLER_DIM_CUBE &&