nouveau/nir: Implement load_global_constant
[mesa.git] / src / gallium / drivers / freedreno / freedreno_query_acc.h
index 8c4415fe73699ecd6132ed84e7a5ca8bbf3ac13f..2092aba4ff3c81710bf30e6da37cb9e1366ce19d 100644 (file)
@@ -59,8 +59,8 @@ struct fd_acc_query;
 struct fd_acc_sample_provider {
        unsigned query_type;
 
-       /* stages applicable to the query type: */
-       enum fd_render_stage active;
+       /* Set if the provider should still count while !ctx->active_queries */
+       bool always;
 
        unsigned size;
 
@@ -77,11 +77,23 @@ struct fd_acc_query {
        const struct fd_acc_sample_provider *provider;
 
        struct pipe_resource *prsc;
-       unsigned offset;
+
+       /* Pointer to the batch that our query has had resume() called on (if
+        * any).
+        */
+       struct fd_batch *batch;
+
+       /* usually the same as provider->size but for batch queries we
+        * need to calculate the size dynamically when the query is
+        * allocated:
+        */
+       unsigned size;
 
        struct list_head node;   /* list-node in ctx->active_acc_queries */
 
        int no_wait_cnt;         /* see fd_acc_get_query_result() */
+
+       void *query_data;        /* query specific data */
 };
 
 static inline struct fd_acc_query *
@@ -90,7 +102,10 @@ fd_acc_query(struct fd_query *q)
        return (struct fd_acc_query *)q;
 }
 
-struct fd_query * fd_acc_create_query(struct fd_context *ctx, unsigned query_type);
+struct fd_query * fd_acc_create_query(struct fd_context *ctx, unsigned query_type,
+       unsigned index);
+struct fd_query * fd_acc_create_query2(struct fd_context *ctx, unsigned query_type,
+               unsigned index, const struct fd_acc_sample_provider *provider);
 void fd_acc_query_set_stage(struct fd_batch *batch, enum fd_render_stage stage);
 void fd_acc_query_register_provider(struct pipe_context *pctx,
                const struct fd_acc_sample_provider *provider);