From 7dc90b68d9d9716fa43f0d64f413a735a92c0f98 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 8 Nov 2021 10:36:54 -0500 Subject: [PATCH] pan/bi: Add second destination to TEXC Used to model dual texturing, which writes to separate sets of staging registers. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/ISA.xml | 3 ++- src/panfrost/bifrost/bifrost_compile.c | 4 ++-- src/panfrost/bifrost/bir.c | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/panfrost/bifrost/ISA.xml b/src/panfrost/bifrost/ISA.xml index c6cb09e7929..2a6b3ff79de 100644 --- a/src/panfrost/bifrost/ISA.xml +++ b/src/panfrost/bifrost/ISA.xml @@ -7689,13 +7689,14 @@ - + + computed_lod zero_lod diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 44bf2334565..2b8967b6160 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -2769,9 +2769,9 @@ bi_emit_texc(bi_builder *b, nir_tex_instr *instr) uint32_t desc_u = 0; memcpy(&desc_u, &desc, sizeof(desc_u)); - bi_texc_to(b, sr_count ? idx : bi_dest_index(&instr->dest), + bi_texc_to(b, sr_count ? idx : bi_dest_index(&instr->dest), bi_null(), idx, cx, cy, bi_imm_u32(desc_u), !computed_lod, - sr_count); + sr_count, 0); /* Explicit copy to facilitate tied operands */ if (sr_count) { diff --git a/src/panfrost/bifrost/bir.c b/src/panfrost/bifrost/bir.c index 78a2965b8a0..92e32f1bb45 100644 --- a/src/panfrost/bifrost/bir.c +++ b/src/panfrost/bifrost/bir.c @@ -107,6 +107,8 @@ bi_count_write_registers(const bi_instr *ins, unsigned d) return bi_count_staging_registers(ins); } else if (ins->op == BI_OPCODE_SEG_ADD_I64) { return 2; + } else if (ins->op == BI_OPCODE_TEXC && d == 1) { + return ins->sr_count_2; } return 1;