From: Christian Gmeiner Date: Fri, 19 Jul 2019 09:45:36 +0000 (+0200) Subject: etnaviv: extend acc query provider with supports(..) function X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6963fcd81fe1a502a68214adc2f3e720a9f9a4c1;p=mesa.git 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 Part-of: --- diff --git a/src/gallium/drivers/etnaviv/etnaviv_query_acc.c b/src/gallium/drivers/etnaviv/etnaviv_query_acc.c index 446a629c6e8..976bfa1c497 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_query_acc.c +++ b/src/gallium/drivers/etnaviv/etnaviv_query_acc.c @@ -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, diff --git a/src/gallium/drivers/etnaviv/etnaviv_query_acc.h b/src/gallium/drivers/etnaviv/etnaviv_query_acc.h index 5927d7da564..b22b2214728 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_query_acc.h +++ b/src/gallium/drivers/etnaviv/etnaviv_query_acc.h @@ -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);