From: Iago Toral Quiroga Date: Thu, 1 Aug 2019 06:48:56 +0000 (+0200) Subject: v3d: be more explicit about the query types supported X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9eb8699e0f53577f203dc63b01fe18b6a2f61734;p=mesa.git v3d: be more explicit about the query types supported Reviewed-by: Eric Anholt --- diff --git a/src/gallium/drivers/v3d/v3d_query.c b/src/gallium/drivers/v3d/v3d_query.c index 31b62461f90..d31b9dd896b 100644 --- a/src/gallium/drivers/v3d/v3d_query.c +++ b/src/gallium/drivers/v3d/v3d_query.c @@ -77,14 +77,18 @@ v3d_begin_query(struct pipe_context *pctx, struct pipe_query *query) case PIPE_QUERY_PRIMITIVES_EMITTED: q->start = v3d->tf_prims_generated; break; - default: + case PIPE_QUERY_OCCLUSION_COUNTER: + case PIPE_QUERY_OCCLUSION_PREDICATE: + case PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE: q->bo = v3d_bo_alloc(v3d->screen, 4096, "query"); - uint32_t *map = v3d_bo_map(q->bo); *map = 0; + v3d->current_oq = q->bo; v3d->dirty |= VC5_DIRTY_OQ; break; + default: + unreachable("unsupported query type"); } return true; @@ -103,10 +107,14 @@ v3d_end_query(struct pipe_context *pctx, struct pipe_query *query) case PIPE_QUERY_PRIMITIVES_EMITTED: q->end = v3d->tf_prims_generated; break; - default: + case PIPE_QUERY_OCCLUSION_COUNTER: + case PIPE_QUERY_OCCLUSION_PREDICATE: + case PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE: v3d->current_oq = NULL; v3d->dirty |= VC5_DIRTY_OQ; break; + default: + unreachable("unsupported query type"); } return true;