From c49b6d7f27319c423ab06ab62be46ee9628f5986 Mon Sep 17 00:00:00 2001 From: Vadim Girlin Date: Thu, 2 May 2013 07:53:00 +0400 Subject: [PATCH] r600g/sb: fix handling of interference sets in post_scheduler post_scheduler clears interference set for reallocatable values when the value becomes live first time, and then updates it to take into account modified order of operations, but this was not handled properly if the value appears first time as a source in copy operation. Fixes issues with webgl demo: http://madebyevan.com/webgl-water/ Signed-off-by: Vadim Girlin --- src/gallium/drivers/r600/sb/sb_sched.cpp | 12 ++++++------ src/gallium/drivers/r600/sb/sb_sched.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gallium/drivers/r600/sb/sb_sched.cpp b/src/gallium/drivers/r600/sb/sb_sched.cpp index 7e9eaccfcd3..d7c17952a4a 100644 --- a/src/gallium/drivers/r600/sb/sb_sched.cpp +++ b/src/gallium/drivers/r600/sb/sb_sched.cpp @@ -874,7 +874,7 @@ void post_scheduler::update_local_interferences() { } } -void post_scheduler::update_live_src_vec(vvec &vv, val_set &born, bool src) { +void post_scheduler::update_live_src_vec(vvec &vv, val_set *born, bool src) { for (vvec::iterator I = vv.begin(), E = vv.end(); I != E; ++I) { value *v = *I; @@ -892,7 +892,8 @@ void post_scheduler::update_live_src_vec(vvec &vv, val_set &born, bool src) { cleared_interf.add_val(v); } } - born.add_val(v); + if (born) + born->add_val(v); } } else if (v->is_rel()) { if (!v->rel->is_any_gpr()) @@ -924,7 +925,7 @@ void post_scheduler::update_live_dst_vec(vvec &vv) { } } -void post_scheduler::update_live(node *n, val_set &born) { +void post_scheduler::update_live(node *n, val_set *born) { update_live_dst_vec(n->dst); update_live_src_vec(n->src, born, true); update_live_src_vec(n->dst, born, false); @@ -948,7 +949,7 @@ void post_scheduler::process_group() { if (!n) continue; - update_live(n, vals_born); + update_live(n, &vals_born); } PSC_DUMP( @@ -1550,8 +1551,7 @@ bool post_scheduler::check_copy(node *n) { if (s->is_prealloc() && !map_src_val(s)) return true; - live.remove_val(d); - live.add_val(s); + update_live(n, NULL); release_src_values(n); n->remove(); diff --git a/src/gallium/drivers/r600/sb/sb_sched.h b/src/gallium/drivers/r600/sb/sb_sched.h index e74046c9c5a..a74484f50b3 100644 --- a/src/gallium/drivers/r600/sb/sb_sched.h +++ b/src/gallium/drivers/r600/sb/sb_sched.h @@ -297,9 +297,9 @@ public: bool recolor_local(value *v); void update_local_interferences(); - void update_live_src_vec(vvec &vv, val_set &born, bool src); + void update_live_src_vec(vvec &vv, val_set *born, bool src); void update_live_dst_vec(vvec &vv); - void update_live(node *n, val_set &born); + void update_live(node *n, val_set *born); void process_group(); void set_color_local_val(value *v, sel_chan color); -- 2.30.2