Module: Mesa Branch: main Commit: 7dc90b68d9d9716fa43f0d64f413a735a92c0f98 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7dc90b68d9d9716fa43f0d64f413a735a92c0f98
Author: Alyssa Rosenzweig <[email protected]> Date: Mon Nov 8 10:36:54 2021 -0500 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 <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13723> --- 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 @@ </mod> </ins> - <ins name="+TEXC" staging="rw=sr_count" mask="0xffc00" exact="0xd7000" message="tex"> + <ins name="+TEXC" staging="rw=sr_count" mask="0xffc00" exact="0xd7000" message="tex" dests="2"> <src start="0"/> <src start="3"/> <src start="6" mask="0xf7"/> <mod name="skip" start="9" size="1" opt="skip"/> <!-- not actually encoded, but used for IR --> <immediate name="sr_count" size="4" pseudo="true"/> + <immediate name="sr_count_2" size="4" pseudo="true"/> <mod name="lod_mode" start="13" size="1" default="zero_lod" pseudo="true"> <opt>computed_lod</opt> <opt>zero_lod</opt> 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;
