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 <christian.gmeiner@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1530>
This commit is contained in:
parent
f47b4eddd9
commit
6963fcd81f
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue