pan/bi: Fix off-by-one in scoreboarding packing

Clauses actually encode the *next* clauses' dependencies.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4382>
This commit is contained in:
Alyssa Rosenzweig 2020-03-26 10:10:33 -04:00 committed by Marge Bot
parent f3726a0874
commit 683cd9b6f4
2 changed files with 5 additions and 6 deletions

View file

@ -43,7 +43,7 @@ bi_pack_header(bi_clause *clause, bi_clause *next, bool is_fragment)
.branch_cond = clause->branch_conditional,
.datareg_writebarrier = clause->data_register_write_barrier,
.datareg = clause->data_register,
.scoreboard_deps = clause->dependencies,
.scoreboard_deps = next ? next->dependencies : 0,
.scoreboard_index = clause->scoreboard_id,
.clause_type = clause->clause_type,
.next_clause_type = next ? next->clause_type : 0,

View file

@ -104,17 +104,16 @@ bi_schedule(bi_context *ctx)
if (is_first)
is_first = false;
else
else {
/* Rule: first instructions cannot have write barriers */
u->dependencies |= (1 << last_id);
u->data_register_write_barrier = true;
}
ids = ids & 1;
last_id = u->scoreboard_id;
u->back_to_back = true;
/* Rule: first instructions cannot have write barriers */
if (!is_first)
u->data_register_write_barrier = true;
u->constant_count = 1;
u->constants[0] = ins->constant.u64;