vc4: Track the last block we emitted at the top level.
This will be used for delaying our VPM reads (which must be unconditional) until just before they're used.
This commit is contained in:
@@ -1956,11 +1956,12 @@ ntq_emit_if(struct vc4_compile *c, nir_if *if_stmt)
|
||||
qir_link_blocks(c->cur_block, after_block);
|
||||
|
||||
qir_set_emit_block(c, after_block);
|
||||
if (was_top_level)
|
||||
if (was_top_level) {
|
||||
c->execute = c->undef;
|
||||
else
|
||||
c->last_top_block = c->cur_block;
|
||||
} else {
|
||||
ntq_activate_execute_for_block(c);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2084,10 +2085,12 @@ ntq_emit_loop(struct vc4_compile *c, nir_loop *loop)
|
||||
qir_link_blocks(c->cur_block, c->loop_break_block);
|
||||
|
||||
qir_set_emit_block(c, c->loop_break_block);
|
||||
if (was_top_level)
|
||||
if (was_top_level) {
|
||||
c->execute = c->undef;
|
||||
else
|
||||
c->last_top_block = c->cur_block;
|
||||
} else {
|
||||
ntq_activate_execute_for_block(c);
|
||||
}
|
||||
|
||||
c->loop_break_block = save_loop_break_block;
|
||||
c->loop_cont_block = save_loop_cont_block;
|
||||
|
@@ -646,6 +646,7 @@ qir_compile_init(void)
|
||||
|
||||
list_inithead(&c->blocks);
|
||||
qir_set_emit_block(c, qir_new_block(c));
|
||||
c->last_top_block = c->cur_block;
|
||||
|
||||
c->output_position_index = -1;
|
||||
c->output_color_index = -1;
|
||||
|
@@ -506,6 +506,7 @@ struct vc4_compile {
|
||||
struct qblock *cur_block;
|
||||
struct qblock *loop_cont_block;
|
||||
struct qblock *loop_break_block;
|
||||
struct qblock *last_top_block;
|
||||
|
||||
struct list_head qpu_inst_list;
|
||||
|
||||
|
Reference in New Issue
Block a user