From f3f1d0dfd034a31c4914148fefbd5543f5dd12fc Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Thu, 1 Aug 2019 12:25:12 -0400 Subject: tgsi_to_nir: add support for TEX_LZ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-By: Timur Kristóf Reviewed-by: Eric Anholt --- src/gallium/auxiliary/nir/tgsi_to_nir.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c index 0a234808428..f33ff1f818c 100644 --- a/src/gallium/auxiliary/nir/tgsi_to_nir.c +++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c @@ -1380,6 +1380,7 @@ ttn_tex(struct ttn_compile *c, nir_alu_dest dest, nir_ssa_def **src) samp = 2; break; case TGSI_OPCODE_TXL: + case TGSI_OPCODE_TEX_LZ: op = nir_texop_txl; num_srcs = 2; break; @@ -1514,8 +1515,12 @@ ttn_tex(struct ttn_compile *c, nir_alu_dest dest, nir_ssa_def **src) src_number++; } - if (tgsi_inst->Instruction.Opcode == TGSI_OPCODE_TXL) { - instr->src[src_number].src = nir_src_for_ssa(ttn_channel(b, src[0], W)); + if (tgsi_inst->Instruction.Opcode == TGSI_OPCODE_TXL || + tgsi_inst->Instruction.Opcode == TGSI_OPCODE_TEX_LZ) { + if (tgsi_inst->Instruction.Opcode == TGSI_OPCODE_TEX_LZ) + instr->src[src_number].src = nir_src_for_ssa(nir_imm_int(b, 0)); + else + instr->src[src_number].src = nir_src_for_ssa(ttn_channel(b, src[0], W)); instr->src[src_number].src_type = nir_tex_src_lod; src_number++; } @@ -1924,6 +1929,7 @@ static const nir_op op_trans[TGSI_OPCODE_LAST] = { [TGSI_OPCODE_SLT] = nir_op_slt, [TGSI_OPCODE_SGE] = nir_op_sge, [TGSI_OPCODE_MAD] = nir_op_ffma, + [TGSI_OPCODE_TEX_LZ] = 0, [TGSI_OPCODE_LRP] = 0, [TGSI_OPCODE_SQRT] = nir_op_fsqrt, [TGSI_OPCODE_FRC] = nir_op_ffract, @@ -2212,6 +2218,7 @@ ttn_emit_instruction(struct ttn_compile *c) break; case TGSI_OPCODE_TEX: + case TGSI_OPCODE_TEX_LZ: case TGSI_OPCODE_TXP: case TGSI_OPCODE_TXL: case TGSI_OPCODE_TXB: -- cgit v1.2.3