Module: Mesa
Branch: master
Commit: 2f81d6fbf0f78ac83da929d10fe74e47c79e7446
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2f81d6fbf0f78ac83da929d10fe74e47c79e7446

Author: Mike Blumenkrantz <[email protected]>
Date:   Fri Dec 18 18:05:23 2020 -0500

zink: manually handle more bool query types for copying

Reviewed-by: Dave Airlie <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>

---

 src/gallium/drivers/zink/zink_query.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_query.c 
b/src/gallium/drivers/zink/zink_query.c
index b651e330f3c..66ef9db37cd 100644
--- a/src/gallium/drivers/zink/zink_query.c
+++ b/src/gallium/drivers/zink/zink_query.c
@@ -154,6 +154,15 @@ is_so_overflow_query(struct zink_query *query)
    return query->type == PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE || query->type 
== PIPE_QUERY_SO_OVERFLOW_PREDICATE;
 }
 
+static bool
+is_bool_query(struct zink_query *query)
+{
+   return is_so_overflow_query(query) ||
+          query->type == PIPE_QUERY_OCCLUSION_PREDICATE ||
+          query->type == PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE ||
+          query->type == PIPE_QUERY_GPU_FINISHED;
+}
+
 static void
 destroy_query(struct zink_screen *screen, struct zink_query *query)
 {
@@ -451,14 +460,14 @@ force_cpu_read(struct zink_context *ctx, struct 
pipe_query *pquery, bool wait, e
          limit = INT_MAX;
       else
          limit = UINT_MAX;
-      if (is_so_overflow_query(query))
+      if (is_bool_query(query))
          u32 = result.b;
       else
          u32 = MIN2(limit, result.u64);
       pipe_buffer_write(pctx, pres, offset, result_size, &u32);
    } else {
       uint64_t u64;
-      if (is_so_overflow_query(query))
+      if (is_bool_query(query))
          u64 = result.b;
       else
          u64 = result.u64;

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to