From 50cfad0298bbb4e341664ed0ec8b4d9b429988dc Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Thu, 4 Jan 2018 16:24:22 +0100 Subject: amd/common: use ac_image_load when lod is zero MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This might decrease VGPR spilling, because we no longer have to use v4i32 for 2D fetches when level == 0. We now use v2i32 for those cases. Signed-off-by: Samuel Pitoiset Reviewed-by: Marek Olšák --- src/amd/common/ac_nir_to_llvm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index e9f997c7a45..90faf0537f7 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -2252,7 +2252,9 @@ static LLVMValueRef build_tex_intrinsic(struct ac_nir_context *ctx, case nir_texop_txf: case nir_texop_txf_ms: case nir_texop_samples_identical: - args->opcode = instr->sampler_dim == GLSL_SAMPLER_DIM_MS ? ac_image_load : ac_image_load_mip; + args->opcode = lod_is_zero || + instr->sampler_dim == GLSL_SAMPLER_DIM_MS ? + ac_image_load : ac_image_load_mip; args->compare = false; args->offset = false; break; -- cgit v1.2.3