mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
pan/bi: Merge BIR_INDEX_FAU and BIR_INDEX_BLEND
There's no reason to separate these, and it's more convenient not to. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
This commit is contained in:
parent
25c9946883
commit
98fabee213
4 changed files with 11 additions and 22 deletions
|
|
@ -167,18 +167,6 @@ bi_assign_fau_idx_single(bi_registers *regs,
|
|||
assigned = true;
|
||||
} else if (ins->src[s] & BIR_INDEX_ZERO && fast_zero) {
|
||||
ins->src[s] = BIR_INDEX_PASS | BIFROST_SRC_STAGE;
|
||||
} else if (ins->src[s] & BIR_INDEX_BLEND) {
|
||||
unsigned rt = ins->blend_location;
|
||||
|
||||
assert(rt <= 7);
|
||||
assert((ins->src[s] & ~BIR_SPECIAL) == BIFROST_SRC_FAU_HI ||
|
||||
(ins->src[s] & ~BIR_SPECIAL) == BIFROST_SRC_FAU_LO);
|
||||
ins->src[s] = BIR_INDEX_PASS | (ins->src[s] & ~BIR_SPECIAL);
|
||||
if (assigned && regs->fau_idx != (8 | rt))
|
||||
unreachable("Mismatched FAU index");
|
||||
|
||||
regs->fau_idx = 8 | rt;
|
||||
assigned = true;
|
||||
} else if (ins->src[s] & BIR_INDEX_FAU) {
|
||||
unsigned index = ins->src[s] & BIR_FAU_TYPE_MASK;
|
||||
bool hi = !!(ins->src[s] & BIR_FAU_HI);
|
||||
|
|
|
|||
|
|
@ -152,7 +152,11 @@ bir_fau_name(unsigned fau_idx)
|
|||
{
|
||||
const char *names[] = {
|
||||
"zero", "lane-id", "wrap-id", "core-id",
|
||||
"fb-extent", "atest-param", "sample-pos"
|
||||
"fb-extent", "atest-param", "sample-pos",
|
||||
"blend_descriptor_0", "blend_descriptor_1",
|
||||
"blend_descriptor_2", "blend_descriptor_3",
|
||||
"blend_descriptor_4", "blend_descriptor_5",
|
||||
"blend_descriptor_6", "blend_descriptor_7",
|
||||
};
|
||||
|
||||
assert(fau_idx < ARRAY_SIZE(names));
|
||||
|
|
@ -171,9 +175,6 @@ bi_print_index(FILE *fp, bi_instruction *ins, unsigned index, unsigned s)
|
|||
fprintf(fp, "#0x%" PRIx64, bi_get_immediate(ins, s));
|
||||
else if (index & BIR_INDEX_ZERO)
|
||||
fprintf(fp, "#0");
|
||||
else if (index & BIR_INDEX_BLEND)
|
||||
fprintf(fp, "blend_descriptor_%u.%c", ins->blend_location,
|
||||
(index & ~BIR_INDEX_BLEND) == BIFROST_SRC_FAU_HI ? 'y' : 'x');
|
||||
else if (index & BIR_INDEX_FAU)
|
||||
fprintf(fp, "%s.%c", bir_fau_name(index & BIR_FAU_TYPE_MASK),
|
||||
(index & BIR_FAU_HI) ? 'y' : 'x');
|
||||
|
|
|
|||
|
|
@ -303,8 +303,8 @@ bi_emit_blend(bi_context *ctx, unsigned rgba, nir_alu_type T, unsigned rt)
|
|||
blend.dest = BIR_INDEX_REGISTER | 0;
|
||||
} else {
|
||||
/* Blend descriptor comes from the FAU RAM */
|
||||
blend.src[2] = BIR_INDEX_BLEND | BIFROST_SRC_FAU_LO;
|
||||
blend.src[3] = BIR_INDEX_BLEND | BIFROST_SRC_FAU_HI;
|
||||
blend.src[2] = BIR_INDEX_FAU | (BIR_FAU_BLEND_0 + rt);
|
||||
blend.src[3] = blend.src[2] | BIR_FAU_HI;
|
||||
|
||||
/* By convention, the return address is stored in r48 and will
|
||||
* be used by the blend shader to jump back to the fragment
|
||||
|
|
|
|||
|
|
@ -537,8 +537,7 @@ bi_remove_instruction(bi_instruction *ins)
|
|||
#define BIR_INDEX_CONSTANT (1 << 29)
|
||||
#define BIR_INDEX_ZERO (1 << 28)
|
||||
#define BIR_INDEX_PASS (1 << 27)
|
||||
#define BIR_INDEX_BLEND (1 << 26)
|
||||
#define BIR_INDEX_FAU (1 << 25)
|
||||
#define BIR_INDEX_FAU (1 << 26)
|
||||
|
||||
enum bir_fau {
|
||||
BIR_FAU_ZERO = 0,
|
||||
|
|
@ -548,6 +547,8 @@ enum bir_fau {
|
|||
BIR_FAU_FB_EXTENT = 4,
|
||||
BIR_FAU_ATEST_PARAM = 5,
|
||||
BIR_FAU_SAMPLE_POS_ARRAY = 6,
|
||||
BIR_FAU_BLEND_0 = 8,
|
||||
/* blend descs 1 - 7 */
|
||||
BIR_FAU_TYPE_MASK = 15,
|
||||
BIR_FAU_HI = (1 << 8),
|
||||
};
|
||||
|
|
@ -556,8 +557,7 @@ enum bir_fau {
|
|||
|
||||
#define BIR_SPECIAL (BIR_INDEX_REGISTER | BIR_INDEX_UNIFORM | \
|
||||
BIR_INDEX_CONSTANT | BIR_INDEX_ZERO | \
|
||||
BIR_INDEX_PASS | BIR_INDEX_BLEND | \
|
||||
BIR_INDEX_FAU)
|
||||
BIR_INDEX_PASS | BIR_INDEX_FAU)
|
||||
|
||||
static inline unsigned
|
||||
bi_max_temp(bi_context *ctx)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue