pan/bi: Allow an extra staging source

Useful for dual source blending.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13714>
This commit is contained in:
Alyssa Rosenzweig 2021-11-08 09:50:43 -05:00 committed by Marge Bot
parent 251b1c1753
commit af3863c658
2 changed files with 6 additions and 6 deletions

View file

@ -1199,21 +1199,21 @@ bi_take_instr(bi_context *ctx, struct bi_worklist st,
}
/* Variant of bi_rewrite_index_src_single that uses word-equivalence, rewriting
* to a passthrough register. If except_zero is true, the zeroth (first) source
* is skipped, so staging register reads are not accidentally encoded as
* to a passthrough register. If except_sr is true, the staging sources are
* skipped, so staging register reads are not accidentally encoded as
* passthrough (which is impossible) */
static void
bi_use_passthrough(bi_instr *ins, bi_index old,
enum bifrost_packed_src new,
bool except_zero)
bool except_sr)
{
/* Optional for convenience */
if (!ins || bi_is_null(old))
return;
bi_foreach_src(ins, i) {
if (i == 0 && except_zero)
if ((i == 0 || i == 4) && except_sr)
continue;
if (bi_is_word_equiv(ins->src[i], old)) {

View file

@ -356,7 +356,7 @@ bi_is_word_equiv(bi_index left, bi_index right)
}
#define BI_MAX_DESTS 2
#define BI_MAX_SRCS 4
#define BI_MAX_SRCS 5
typedef struct {
/* Must be first */
@ -500,7 +500,7 @@ typedef struct {
static inline bool
bi_is_staging_src(bi_instr *I, unsigned s)
{
return (s == 0) && bi_opcode_props[I->op].sr_read;
return (s == 0 || s == 4) && bi_opcode_props[I->op].sr_read;
}
/* Represents the assignment of slots for a given bi_tuple */