summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2016-04-20 09:22:48 -0500
committerNicolai Hähnle <nicolai.haehnle@amd.com>2016-04-21 22:32:50 -0500
commit32214e0c6837a24ad82152e9971baa3926992498 (patch)
tree8a455e6552f76440dd71d85c0e5381a6526428fc /src/gallium/drivers/r300
parent6a0d036483caf87d43ebe2edd1905873446c9589 (diff)
downloadexternal_mesa3d-32214e0c6837a24ad82152e9971baa3926992498.zip
external_mesa3d-32214e0c6837a24ad82152e9971baa3926992498.tar.gz
external_mesa3d-32214e0c6837a24ad82152e9971baa3926992498.tar.bz2
gallium: add bool return to pipe_context::end_query
Even when begin_query succeeds, there can still be failures in query handling. For example for radeon, additional buffers may have to be allocated when queries span multiple command buffers. Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r--src/gallium/drivers/r300/r300_query.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/drivers/r300/r300_query.c b/src/gallium/drivers/r300/r300_query.c
index 7603985..8557eb7 100644
--- a/src/gallium/drivers/r300/r300_query.c
+++ b/src/gallium/drivers/r300/r300_query.c
@@ -110,7 +110,7 @@ void r300_stop_query(struct r300_context *r300)
r300->query_current = NULL;
}
-static void r300_end_query(struct pipe_context* pipe,
+static bool r300_end_query(struct pipe_context* pipe,
struct pipe_query* query)
{
struct r300_context* r300 = r300_context(pipe);
@@ -120,16 +120,18 @@ static void r300_end_query(struct pipe_context* pipe,
pb_reference(&q->buf, NULL);
r300_flush(pipe, RADEON_FLUSH_ASYNC,
(struct pipe_fence_handle**)&q->buf);
- return;
+ return true;
}
if (q != r300->query_current) {
fprintf(stderr, "r300: end_query: Got invalid query.\n");
assert(0);
- return;
+ return false;
}
r300_stop_query(r300);
+
+ return true;
}
static boolean r300_get_query_result(struct pipe_context* pipe,