[Mesa-dev] [PATCH 2/2] radeon: Implement the get_query_result_resource() call-in site

Edward O'Callaghan eocallaghan at alterapraxis.com
Sat Apr 9 05:13:36 UTC 2016


Implement the frontend part of the ARB_query_buffer_object
gallium callback into the driver query_ops.

Signed-off-by: Edward O'Callaghan <eocallaghan at alterapraxis.com>
---
 src/gallium/drivers/radeon/r600_query.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/src/gallium/drivers/radeon/r600_query.c b/src/gallium/drivers/radeon/r600_query.c
index 7a2d2ee..b75ad2d 100644
--- a/src/gallium/drivers/radeon/r600_query.c
+++ b/src/gallium/drivers/radeon/r600_query.c
@@ -899,6 +899,24 @@ static void r600_query_hw_add_result(struct r600_common_context *ctx,
 	}
 }
 
+static void r600_get_query_result_resource(struct pipe_context *ctx,
+					   struct pipe_query *query, boolean wait,
+					   enum pipe_query_value_type result_type,
+					   int index, struct pipe_resource *resource,
+					   unsigned offset)
+{
+	struct r600_common_context *rctx = (struct r600_common_context *)ctx;
+	struct r600_query *rquery = (struct r600_query *)query;
+
+	if (!rquery->ops->get_query_result_resource) {
+	   assert(!"Unexpected lack of get_query_result_resource");
+	   return;
+	}
+
+	rquery->ops->get_query_result_resource(rctx, rquery, wait, result_type,
+					       index, resource, offset);
+}
+
 static boolean r600_get_query_result(struct pipe_context *ctx,
 				     struct pipe_query *query, boolean wait,
 				     union pipe_query_result *result)
@@ -1269,6 +1287,7 @@ void r600_query_init(struct r600_common_context *rctx)
 	rctx->b.begin_query = r600_begin_query;
 	rctx->b.end_query = r600_end_query;
 	rctx->b.get_query_result = r600_get_query_result;
+	rctx->b.get_query_result_resource = r600_get_query_result_resource;
 	rctx->render_cond_atom.emit = r600_emit_query_predication;
 
 	if (((struct r600_common_screen*)rctx->b.screen)->info.num_render_backends > 0)
-- 
2.5.5



More information about the mesa-dev mailing list