The state tracker only gets to begin/query/destroy when !active and end
when active, so we have no need to try to track this ourselves.
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4456>
{
struct etna_query *q = etna_query(pq);
- if (q->active)
- return false;
-
q->funcs->begin_query(etna_context(pctx), q);
- q->active = true;
return true;
}
{
struct etna_query *q = etna_query(pq);
- if (!q->active)
- return false;
-
q->funcs->end_query(etna_context(pctx), q);
- q->active = false;
return true;
}
{
struct etna_query *q = etna_query(pq);
- if (q->active)
- return false;
-
util_query_clear_result(result, q->type);
return q->funcs->get_query_result(etna_context(pctx), q, wait, result);
struct etna_query {
const struct etna_query_funcs *funcs;
- bool active;
unsigned type;
};
{
const struct etna_acc_sample_provider *p = aq->provider;
- if (!aq->base.active)
- return;
-
p->suspend(aq, ctx);
aq->samples++;
}
{
const struct etna_acc_sample_provider *p = aq->provider;
- if (!aq->base.active)
- return;
-
p->resume(aq, ctx);
aq->samples++;
}