From: Rhys Perry Date: Sat, 21 Sep 2019 14:33:44 +0000 (+0100) Subject: aco: don't use p_as_uniform for vgpr sampler/image indices X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f13ad839f11aed68075b735ca0ac04ab9fecd154;p=mesa.git aco: don't use p_as_uniform for vgpr sampler/image indices 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 --- 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);