Commit 6963fcd8 authored by Christian Gmeiner's avatar Christian Gmeiner Committed by Marge Bot
Browse files

etnaviv: extend acc query provider with supports(..) function



Move the logic if a query provider supports a query_type
directly to the provider.
Signed-off-by: Christian Gmeiner's avatarChristian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <mesa/mesa!1530>
parent f47b4edd
......@@ -42,6 +42,21 @@
* interpret results
*/
static bool
occlusion_supports(unsigned query_type)
{
switch (query_type) {
case PIPE_QUERY_OCCLUSION_COUNTER:
/* fallthrough */
case PIPE_QUERY_OCCLUSION_PREDICATE:
/* fallthrough */
case PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE:
return true;
default:
return false;
}
}
static void
occlusion_resume(struct etna_acc_query *aq, struct etna_context *ctx)
{
......@@ -98,6 +113,7 @@ etna_acc_destroy_query(struct etna_context *ctx, struct etna_query *q)
}
static const struct etna_acc_sample_provider occlusion_provider = {
.supports = occlusion_supports,
.suspend = occlusion_suspend,
.resume = occlusion_resume,
.result = occlusion_result,
......
......@@ -34,6 +34,8 @@
struct etna_acc_query;
struct etna_acc_sample_provider {
bool (*supports)(unsigned query_type);
void (*resume)(struct etna_acc_query *aq, struct etna_context *ctx);
void (*suspend)(struct etna_acc_query *aq, struct etna_context *ctx);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment