[Mesa-dev] [PATCH 21/21] [RFC] hack enable sb for tess

Dave Airlie airlied at gmail.com
Wed Jan 10 06:49:00 UTC 2018


From: Dave Airlie <airlied at redhat.com>

Don't apply this until we have a lot more tests passing

this disables SB for barrier usage (as those will be a lot of
"fun")
---
 src/gallium/drivers/r600/r600_shader.c | 11 ++++-------
 src/gallium/drivers/r600/r600_shader.h |  1 +
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index 773eb079d2..ceb770a01f 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -183,18 +183,14 @@ int r600_pipe_shader_create(struct pipe_context *ctx,
 		R600_ERR("translation from TGSI failed !\n");
 		goto error;
 	}
-	if (shader->shader.processor_type == PIPE_SHADER_VERTEX) {
-		/* only disable for vertex shaders in tess paths */
-		if (key.vs.as_ls)
-			use_sb = 0;
-	}
-	use_sb &= (shader->shader.processor_type != PIPE_SHADER_TESS_CTRL);
-	use_sb &= (shader->shader.processor_type != PIPE_SHADER_TESS_EVAL);
 	use_sb &= (shader->shader.processor_type != PIPE_SHADER_COMPUTE);
 
 	/* disable SB for shaders using doubles */
 	use_sb &= !shader->shader.uses_doubles;
 
+	/* disable SB for barriers */
+	use_sb &= !shader->shader.uses_barrier;
+
 	use_sb &= !shader->shader.uses_atomics;
 	use_sb &= !shader->shader.uses_images;
 
@@ -3124,6 +3120,7 @@ static int r600_shader_from_tgsi(struct r600_context *rctx,
 	shader->uses_atomics = ctx.info.file_mask[TGSI_FILE_HW_ATOMIC];
 	shader->nsys_inputs = 0;
 
+	shader->uses_barrier = ctx.info.opcode_count[TGSI_OPCODE_BARRIER] + ctx.info.opcode_count[TGSI_OPCODE_MEMBAR];
 	shader->uses_images = ctx.info.file_count[TGSI_FILE_IMAGE] > 0 ||
 		ctx.info.file_count[TGSI_FILE_BUFFER] > 0;
 	indirect_gprs = ctx.info.indirect_files & ~((1 << TGSI_FILE_CONSTANT) | (1 << TGSI_FILE_SAMPLER));
diff --git a/src/gallium/drivers/r600/r600_shader.h b/src/gallium/drivers/r600/r600_shader.h
index 8444907883..ad65055295 100644
--- a/src/gallium/drivers/r600/r600_shader.h
+++ b/src/gallium/drivers/r600/r600_shader.h
@@ -119,6 +119,7 @@ struct r600_shader {
 	boolean			uses_doubles;
 	boolean                 uses_atomics;
 	boolean			uses_images;
+	boolean			uses_barrier;
 	uint8_t                 atomic_base;
 	uint8_t			rat_base;
 	uint8_t                 image_size_const_offset;
-- 
2.14.3



More information about the mesa-dev mailing list