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 <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13723>
This commit is contained in:
Alyssa Rosenzweig 2021-11-08 10:36:54 -05:00 committed by Marge Bot
parent 8e02731624
commit 7dc90b68d9
3 changed files with 6 additions and 3 deletions

View File

@ -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>

View File

@ -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) {

View File

@ -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;