From: Kenneth Graunke Date: Tue, 27 Nov 2018 22:20:48 +0000 (-0800) Subject: iris: check query first X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=40b12c103ca0173a1223c2cb37fe40901881b5ec;p=mesa.git iris: check query first this lets us avoid the predicate bit in more cases, which is nice --- diff --git a/src/gallium/drivers/iris/iris_query.c b/src/gallium/drivers/iris/iris_query.c index 27126d7f7bc..61b0e27a0cb 100644 --- a/src/gallium/drivers/iris/iris_query.c +++ b/src/gallium/drivers/iris/iris_query.c @@ -546,6 +546,21 @@ iris_end_query(struct pipe_context *ctx, struct pipe_query *query) return true; } +/** + * See if the snapshots have landed for a query, and if so, compute the + * result and mark it ready. Does not flush (unlike iris_get_query_result). + */ +static void +iris_check_query_no_flush(struct iris_context *ice, struct iris_query *q) +{ + struct iris_screen *screen = (void *) ice->ctx.screen; + const struct gen_device_info *devinfo = &screen->devinfo; + + if (!q->ready && q->map->snapshots_landed) { + calculate_result_on_cpu(devinfo, q); + } +} + static boolean iris_get_query_result(struct pipe_context *ctx, struct pipe_query *query, @@ -815,6 +830,8 @@ iris_render_condition(struct pipe_context *ctx, return; } + iris_check_query_no_flush(ice, q); + if (q->result || q->ready) set_predicate_enable(ice, (q->result != 0) ^ condition); else