From: Nicolai Hähnle Date: Sat, 24 Jun 2017 15:29:43 +0000 (+0200) Subject: ac/nir: handle old-style shadow tex instructions correctly X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9061dca8724846f88fffd2da67099c5c626f2c9f;p=mesa.git ac/nir: handle old-style shadow tex instructions correctly The first element is only extracted for new-style shadow tex. Reviewed-by: Marek Olšák --- diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index d041e6a9dd5..3125ade3b3f 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -4624,7 +4624,9 @@ static void visit_tex(struct ac_nir_context *ctx, nir_tex_instr *instr) if (instr->op == nir_texop_query_levels) result = LLVMBuildExtractElement(ctx->ac.builder, result, LLVMConstInt(ctx->ac.i32, 3, false), ""); - else if (instr->is_shadow && instr->op != nir_texop_txs && instr->op != nir_texop_lod && instr->op != nir_texop_tg4) + else if (instr->is_shadow && instr->is_new_style_shadow && + instr->op != nir_texop_txs && instr->op != nir_texop_lod && + instr->op != nir_texop_tg4) result = LLVMBuildExtractElement(ctx->ac.builder, result, ctx->ac.i32_0, ""); else if (instr->op == nir_texop_txs && instr->sampler_dim == GLSL_SAMPLER_DIM_CUBE &&