[Mesa-dev] [PATCH] r600/query: drop rest of vi workaround code.

Dave Airlie airlied at gmail.com
Thu Nov 9 05:54:03 UTC 2017


From: Dave Airlie <airlied at redhat.com>

This isn't needed in r600 anymore.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/gallium/drivers/r600/r600_query.c | 46 ++++++++++-------------------------
 src/gallium/drivers/r600/r600_query.h |  4 ---
 2 files changed, 13 insertions(+), 37 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_query.c b/src/gallium/drivers/r600/r600_query.c
index aa3e36f..0003e2b 100644
--- a/src/gallium/drivers/r600/r600_query.c
+++ b/src/gallium/drivers/r600/r600_query.c
@@ -506,7 +506,6 @@ void r600_query_hw_destroy(struct r600_common_screen *rscreen,
 	}
 
 	r600_resource_reference(&query->buffer.buf, NULL);
-	r600_resource_reference(&query->workaround_buf, NULL);
 	FREE(rquery);
 }
 
@@ -932,23 +931,19 @@ static void r600_emit_query_predication(struct r600_common_context *ctx,
 	flag_wait = ctx->render_cond_mode == PIPE_RENDER_COND_WAIT ||
 		    ctx->render_cond_mode == PIPE_RENDER_COND_BY_REGION_WAIT;
 
-	if (query->workaround_buf) {
-		op = PRED_OP(PREDICATION_OP_BOOL64);
-	} else {
-		switch (query->b.type) {
-		case PIPE_QUERY_OCCLUSION_COUNTER:
-		case PIPE_QUERY_OCCLUSION_PREDICATE:
-			op = PRED_OP(PREDICATION_OP_ZPASS);
-			break;
-		case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
-		case PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE:
-			op = PRED_OP(PREDICATION_OP_PRIMCOUNT);
-			invert = !invert;
-			break;
-		default:
-			assert(0);
-			return;
-		}
+	switch (query->b.type) {
+	case PIPE_QUERY_OCCLUSION_COUNTER:
+	case PIPE_QUERY_OCCLUSION_PREDICATE:
+		op = PRED_OP(PREDICATION_OP_ZPASS);
+		break;
+	case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
+	case PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE:
+		op = PRED_OP(PREDICATION_OP_PRIMCOUNT);
+		invert = !invert;
+		break;
+	default:
+		assert(0);
+		return;
 	}
 
 	/* if true then invert, see GL_ARB_conditional_render_inverted */
@@ -957,19 +952,6 @@ static void r600_emit_query_predication(struct r600_common_context *ctx,
 	else
 		op |= PREDICATION_DRAW_VISIBLE; /* Draw if visible or no overflow */
 
-	/* Use the value written by compute shader as a workaround. Note that
-	 * the wait flag does not apply in this predication mode.
-	 *
-	 * The shader outputs the result value to L2. Workarounds only affect VI
-	 * and later, where the CP reads data from L2, so we don't need an
-	 * additional flush.
-	 */
-	if (query->workaround_buf) {
-		uint64_t va = query->workaround_buf->gpu_address + query->workaround_offset;
-		emit_set_predicate(ctx, query->workaround_buf, va, op);
-		return;
-	}
-
 	op |= flag_wait ? PREDICATION_HINT_WAIT : PREDICATION_HINT_NOWAIT_DRAW;
 
 	/* emit predicate packets for all data blocks */
@@ -1067,8 +1049,6 @@ bool r600_query_hw_begin(struct r600_common_context *rctx,
 	if (!(query->flags & R600_QUERY_HW_FLAG_BEGIN_RESUMES))
 		r600_query_hw_reset_buffers(rctx, query);
 
-	r600_resource_reference(&query->workaround_buf, NULL);
-
 	r600_query_hw_emit_start(rctx, query);
 	if (!query->buffer.buf)
 		return false;
diff --git a/src/gallium/drivers/r600/r600_query.h b/src/gallium/drivers/r600/r600_query.h
index 1a3c683..acba1a6 100644
--- a/src/gallium/drivers/r600/r600_query.h
+++ b/src/gallium/drivers/r600/r600_query.h
@@ -193,10 +193,6 @@ struct r600_query_hw {
 	struct list_head list;
 	/* For transform feedback: which stream the query is for */
 	unsigned stream;
-
-	/* Workaround via compute shader */
-	struct r600_resource *workaround_buf;
-	unsigned workaround_offset;
 };
 
 bool r600_query_hw_init(struct r600_common_screen *rscreen,
-- 
2.9.5



More information about the mesa-dev mailing list