freedreno/a3xx: fix for unused inputs
An unused input might not have a register assigned. We don't want bogus regid to result in impossibly high max_reg.. Signed-off-by: Rob Clark <robclark@freedesktop.org>
This commit is contained in:
@@ -80,10 +80,16 @@ static void
|
||||
fixup_vp_regfootprint(struct fd3_shader_variant *so)
|
||||
{
|
||||
unsigned i;
|
||||
for (i = 0; i < so->inputs_count; i++)
|
||||
so->info.max_reg = MAX2(so->info.max_reg, (so->inputs[i].regid + 3) >> 2);
|
||||
for (i = 0; i < so->outputs_count; i++)
|
||||
so->info.max_reg = MAX2(so->info.max_reg, (so->outputs[i].regid + 3) >> 2);
|
||||
for (i = 0; i < so->inputs_count; i++) {
|
||||
if (so->inputs[i].compmask) {
|
||||
uint32_t regid = (so->inputs[i].regid + 3) >> 2;
|
||||
so->info.max_reg = MAX2(so->info.max_reg, regid);
|
||||
}
|
||||
}
|
||||
for (i = 0; i < so->outputs_count; i++) {
|
||||
uint32_t regid = (so->outputs[i].regid + 3) >> 2;
|
||||
so->info.max_reg = MAX2(so->info.max_reg, regid);
|
||||
}
|
||||
}
|
||||
|
||||
static struct fd3_shader_variant *
|
||||
|
||||
@@ -565,7 +565,7 @@ static void legalize(struct ir3_ra_ctx *ctx, struct ir3_block *block)
|
||||
struct ir3_instruction *end =
|
||||
ir3_instr_create(block, 0, OPC_END);
|
||||
struct ir3_instruction *last_input = NULL;
|
||||
regmask_t needs_ss_war;
|
||||
regmask_t needs_ss_war; /* write after read */
|
||||
regmask_t needs_ss;
|
||||
regmask_t needs_sy;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user