diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 0176c994e6d..bd027fadda6 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -9169,13 +9169,9 @@ prepare_cube_coords(isel_context* ctx, std::vector& coords, Temp* ddx, Tem aco_opcode madmk = ctx->program->gfx_level >= GFX10_3 ? aco_opcode::v_fmamk_f32 : aco_opcode::v_madmk_f32; - if (is_array) { - coords[3] = bld.vop1(aco_opcode::v_rndne_f32, bld.def(v1), coords[3]); - - /* see comment in ac_prepare_cube_coords() */ - if (ctx->options->gfx_level <= GFX8) - coords[3] = bld.vop2(aco_opcode::v_max_f32, bld.def(v1), Operand::zero(), coords[3]); - } + /* see comment in ac_prepare_cube_coords() */ + if (is_array && ctx->options->gfx_level <= GFX8) + coords[3] = bld.vop2(aco_opcode::v_max_f32, bld.def(v1), Operand::zero(), coords[3]); ma = bld.vop3(aco_opcode::v_cubema_f32, bld.def(v1), coords[0], coords[1], coords[2]); @@ -9425,18 +9421,6 @@ visit_tex(isel_context* ctx, nir_tex_instr* instr) has_derivs = true; } - if (instr->coord_components > 1 && instr->sampler_dim == GLSL_SAMPLER_DIM_1D && - instr->is_array && instr->op != nir_texop_txf) - coords[1] = bld.vop1(aco_opcode::v_rndne_f32, bld.def(v1), coords[1]); - - if (instr->coord_components > 2 && - (instr->sampler_dim == GLSL_SAMPLER_DIM_2D || instr->sampler_dim == GLSL_SAMPLER_DIM_MS || - instr->sampler_dim == GLSL_SAMPLER_DIM_SUBPASS || - instr->sampler_dim == GLSL_SAMPLER_DIM_SUBPASS_MS) && - instr->is_array && instr->op != nir_texop_txf && instr->op != nir_texop_fragment_fetch_amd && - instr->op != nir_texop_fragment_mask_fetch_amd) - coords[2] = bld.vop1(aco_opcode::v_rndne_f32, bld.def(v1), coords[2]); - if (ctx->options->gfx_level == GFX9 && instr->sampler_dim == GLSL_SAMPLER_DIM_1D && instr->op != nir_texop_lod && instr->coord_components) { assert(coords.size() > 0 && coords.size() < 3); diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index a0233ef4df7..4dc180f8616 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -827,6 +827,7 @@ radv_shader_spirv_to_nir(struct radv_device *device, const struct radv_pipeline_ .lower_to_fragment_fetch_amd = true, .lower_lod_zero_width = true, .lower_invalid_implicit_lod = true, + .lower_array_layer_round_even = true, }; NIR_PASS(_, nir, nir_lower_tex, &tex_options);