diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 59c87a262cc..275c1008f2b 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -9347,7 +9347,9 @@ visit_tex(isel_context* ctx, nir_tex_instr* instr) return; } - if (has_offset && instr->op != nir_texop_txf) { + if (has_offset) { + assert(instr->op != nir_texop_txf); + aco_ptr tmp_instr; Temp acc, pack = Temp(); @@ -9454,14 +9456,6 @@ visit_tex(isel_context* ctx, nir_tex_instr* instr) bool da = should_declare_array(ctx, instr->sampler_dim, instr->is_array); - if (has_offset && instr->op == nir_texop_txf) { - for (unsigned i = 0; i < std::min(offset.size(), instr->coord_components); i++) { - Temp off = emit_extract_vector(ctx, offset, i, v1); - coords[i] = bld.vadd32(bld.def(v1), coords[i], off); - } - has_offset = false; - } - /* Build tex instruction */ unsigned dmask = nir_ssa_def_components_read(&instr->dest.ssa) & 0xf; if (instr->sampler_dim == GLSL_SAMPLER_DIM_BUF) diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index ec5c00f0b1d..21174c2ed10 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -820,6 +820,7 @@ radv_shader_spirv_to_nir(struct radv_device *device, const struct radv_pipeline_ static const nir_lower_tex_options tex_options = { .lower_txp = ~0, + .lower_txf_offset = true, .lower_tg4_offsets = true, .lower_txs_cube_array = true, .lower_to_fragment_fetch_amd = true,