From f13ad839f11aed68075b735ca0ac04ab9fecd154 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Sat, 21 Sep 2019 15:33:44 +0100 Subject: [PATCH] aco: don't use p_as_uniform for vgpr sampler/image indices MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit p_as_uniform can get CSE'd, which can be incorrect and break some dEQP-VK.descriptor_indexing.* tests. Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann --- src/amd/compiler/aco_instruction_selection.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index f521492bc78..bdb7e2a549e 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -3439,7 +3439,9 @@ Temp get_sampler_desc(isel_context *ctx, nir_deref_instr *deref_instr, if (const_value) { constant_index += array_size * const_value->u32; } else { - Temp indirect = bld.as_uniform(get_ssa_temp(ctx, deref_instr->arr.index.ssa)); + Temp indirect = get_ssa_temp(ctx, deref_instr->arr.index.ssa); + if (indirect.type() == RegType::vgpr) + indirect = bld.vop1(aco_opcode::v_readfirstlane_b32, bld.def(s1), indirect); if (array_size != 1) indirect = bld.sop2(aco_opcode::s_mul_i32, bld.def(s1), Operand(array_size), indirect); -- 2.30.2