[Mesa-dev] [PATCH 2/4] r600g/sb: fix handling of interference sets in post_scheduler

Vadim Girlin vadimgirlin at gmail.com
Thu May 2 08:46:56 PDT 2013


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 <vadimgirlin at gmail.com>
---
 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 7e9eacc..d7c1795 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 e74046c..a74484f 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);
-- 
1.8.2.1



More information about the mesa-dev mailing list