diff options
author | Rob Clark <[email protected]> | 2017-04-21 09:50:30 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2017-04-22 10:03:01 -0400 |
commit | df63ff4d8248d81ecb8d0f3059bf2c67431e6f2f (patch) | |
tree | 6bdc94b7326d0367ebdf6b5579fca13e19997ff4 /src/gallium/drivers/freedreno/freedreno_context.h | |
parent | 2faf227ec2e22c7a37e0a54783a3f0a0062ac852 (diff) |
freedreno: make hw-query a helper
For a5xx (and actually some queries on a4xx) we can accumulate results
in the cmdstream, so we don't need this elaborate mechanism of tracking
per-tile query results. So make it into vfuncs so generation specific
backend can use it when it makes sense.
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_context.h')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_context.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_context.h b/src/gallium/drivers/freedreno/freedreno_context.h index 733c64b1807..fe685e1767d 100644 --- a/src/gallium/drivers/freedreno/freedreno_context.h +++ b/src/gallium/drivers/freedreno/freedreno_context.h @@ -291,6 +291,14 @@ struct fd_context { /* indirect-branch emit: */ void (*emit_ib)(struct fd_ringbuffer *ring, struct fd_ringbuffer *target); + /* query: */ + struct fd_query * (*create_query)(struct fd_context *ctx, unsigned query_type); + void (*query_prepare)(struct fd_batch *batch, uint32_t num_tiles); + void (*query_prepare_tile)(struct fd_batch *batch, uint32_t n, + struct fd_ringbuffer *ring); + void (*query_set_stage)(struct fd_batch *batch, + struct fd_ringbuffer *ring, enum fd_render_stage stage); + /* * Common pre-cooked VBO state (used for a3xx and later): */ @@ -368,6 +376,15 @@ fd_supported_prim(struct fd_context *ctx, unsigned prim) return (1 << prim) & ctx->primtype_mask; } +static inline void +fd_batch_set_stage(struct fd_batch *batch, + struct fd_ringbuffer *ring, enum fd_render_stage stage) +{ + struct fd_context *ctx = batch->ctx; + if (ctx->query_set_stage) + ctx->query_set_stage(batch, ring, stage); +} + void fd_context_setup_common_vbos(struct fd_context *ctx); void fd_context_cleanup_common_vbos(struct fd_context *ctx); |