[Mesa-dev] [RFC PATCH 1/2] r600/sb: Set flags for GROUP_BARRIER instruction and force it into slot X

Gert Wollny gw.fossdev at gmail.com
Wed Jan 10 15:36:48 UTC 2018


This seems to satisfy the sb optimizer, i.e. no regressions in the piglits
compared to disabling sb for tesselation shaders with barriers but enabling
them in general.
---
The series goes on top of the r600 sb tessellation support patches. 

Best,
Gert

 src/gallium/drivers/r600/sb/sb_bc.h          | 3 +++
 src/gallium/drivers/r600/sb/sb_bc_parser.cpp | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/src/gallium/drivers/r600/sb/sb_bc.h b/src/gallium/drivers/r600/sb/sb_bc.h
index b35671bf0f..a5eed57e5e 100644
--- a/src/gallium/drivers/r600/sb/sb_bc.h
+++ b/src/gallium/drivers/r600/sb/sb_bc.h
@@ -714,6 +714,9 @@ public:
 		/* Force LDS_IDX ops into SLOT_X */
 		if (op_ptr->opcode[0] == -1 && ((op_ptr->opcode[1] & 0xFF) == 0x11))
 			mask = 0x01;
+		/*  force GROUP_BARRIER into SLOT_X */
+		if (op_ptr->opcode[0] == -1 && (op_ptr->opcode[1] == 0x54))
+			mask = 0x01;
 		return mask;
 	}
 
diff --git a/src/gallium/drivers/r600/sb/sb_bc_parser.cpp b/src/gallium/drivers/r600/sb/sb_bc_parser.cpp
index 970e4141d5..1ddf5c541b 100644
--- a/src/gallium/drivers/r600/sb/sb_bc_parser.cpp
+++ b/src/gallium/drivers/r600/sb/sb_bc_parser.cpp
@@ -439,6 +439,9 @@ int bc_parser::prepare_alu_group(cf_node* cf, alu_group_node *g) {
 			n->dst.resize(1);
 		}
 
+		if (n->bc.op == ALU_OP0_GROUP_BARRIER)
+			n->flags |= NF_DONT_HOIST | NF_DONT_MOVE | NF_DONT_KILL;
+
 		if (n->bc.op == ALU_OP0_SET_CF_IDX0 || n->bc.op == ALU_OP0_SET_CF_IDX1) {
 			// Move CF_IDX value into tex instruction operands, scheduler will later re-emit setting of CF_IDX
 			// DCE will kill this op
-- 
2.13.6



More information about the mesa-dev mailing list