This allows doing occlusion queries in one frame and getting the
results in the next frame without having to flush.
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5676>
struct mali_vertex_tiler_postfix *postfix)
{
SET_BIT(postfix->gl_enables, MALI_OCCLUSION_QUERY, ctx->occlusion_query);
- if (ctx->occlusion_query)
+ if (ctx->occlusion_query) {
postfix->occlusion_counter = ctx->occlusion_query->bo->gpu;
- else
+ panfrost_batch_add_bo(ctx->batch, ctx->occlusion_query->bo,
+ PAN_BO_ACCESS_SHARED |
+ PAN_BO_ACCESS_RW |
+ PAN_BO_ACCESS_FRAGMENT);
+ } else {
postfix->occlusion_counter = 0;
+ }
}
void
case PIPE_QUERY_OCCLUSION_PREDICATE:
case PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE:
DBG("Flushing for occlusion query\n");
- panfrost_flush_all_batches(ctx, true);
+ panfrost_flush_batches_accessing_bo(ctx, query->bo, PAN_BO_ACCESS_WRITE);
+ panfrost_bo_wait(query->bo, INT64_MAX, PAN_BO_ACCESS_WRITE);
/* Read back the query results */
unsigned *result = (unsigned *) query->bo->cpu;