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

Author: Mike Blumenkrantz <[email protected]>
Date:   Fri Feb  5 19:31:05 2021 -0500

zink: put SO_OVERFLOW queries on the primgen list

these need to know if xfb was active during the query

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

---

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

diff --git a/src/gallium/drivers/zink/zink_query.c 
b/src/gallium/drivers/zink/zink_query.c
index 26a117558df..9914de54b33 100644
--- a/src/gallium/drivers/zink/zink_query.c
+++ b/src/gallium/drivers/zink/zink_query.c
@@ -92,6 +92,14 @@ convert_query_type(unsigned query_type, bool *use_64bit, 
bool *precise)
    }
 }
 
+static bool
+needs_stats_list(struct zink_query *query)
+{
+   return query->type == PIPE_QUERY_PRIMITIVES_GENERATED ||
+          query->type == PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE ||
+          query->type == PIPE_QUERY_SO_OVERFLOW_PREDICATE;
+}
+
 static bool
 is_time_query(struct zink_query *query)
 {
@@ -391,7 +399,7 @@ begin_query(struct zink_context *ctx, struct zink_batch 
*batch, struct zink_quer
    if (!batch->active_queries)
       batch->active_queries = _mesa_set_create(NULL, _mesa_hash_pointer, 
_mesa_key_pointer_equal);
    assert(batch->active_queries);
-   if (q->type == PIPE_QUERY_PRIMITIVES_GENERATED)
+   if (needs_stats_list(q))
       list_addtail(&q->stats_list, &ctx->primitives_generated_queries);
    p_atomic_inc(&q->fences);
    q->batch_id = batch->batch_id;
@@ -430,7 +438,7 @@ end_query(struct zink_context *ctx, struct zink_batch 
*batch, struct zink_query
                                        q->curr_query, q->index);
    if (q->vkqtype != VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT && 
!is_time_query(q))
       vkCmdEndQuery(batch->cmdbuf, q->query_pool, q->curr_query);
-   if (q->type == PIPE_QUERY_PRIMITIVES_GENERATED)
+   if (needs_stats_list(q))
       list_delinit(&q->stats_list);
    if (++q->curr_query == q->num_queries) {
       /* always reset on start; this ensures we can actually submit the batch 
that the current query is on */
@@ -446,7 +454,7 @@ zink_end_query(struct pipe_context *pctx,
    struct zink_query *query = (struct zink_query *)q;
    struct zink_batch *batch = zink_curr_batch(ctx);
 
-   if (query->type == PIPE_QUERY_PRIMITIVES_GENERATED)
+   if (needs_stats_list(query))
       list_delinit(&query->stats_list);
    if (query->active)
       end_query(ctx, batch, query);

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

Reply via email to