diff options
author | Marek Olšák <[email protected]> | 2016-07-22 17:30:06 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-07-26 23:06:46 +0200 |
commit | 1f85f179982f1cd6bd06e1e5899754005dc34828 (patch) | |
tree | f17018433437ff48d47229b422307e259153b893 /src | |
parent | 6b9924ccb67ad04ef8f3020dd08a5b47d4ec06e2 (diff) |
ddebug: implement create_batch_query
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/ddebug/dd_context.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/gallium/drivers/ddebug/dd_context.c b/src/gallium/drivers/ddebug/dd_context.c index c0b2b3ddd7e..77fb9ae726c 100644 --- a/src/gallium/drivers/ddebug/dd_context.c +++ b/src/gallium/drivers/ddebug/dd_context.c @@ -85,6 +85,32 @@ dd_context_create_query(struct pipe_context *_pipe, unsigned query_type, return query; } +static struct pipe_query * +dd_context_create_batch_query(struct pipe_context *_pipe, unsigned num_queries, + unsigned *query_types) +{ + struct pipe_context *pipe = dd_context(_pipe)->pipe; + struct pipe_query *query; + + query = pipe->create_batch_query(pipe, num_queries, query_types); + + /* Wrap query object. */ + if (query) { + struct dd_query *dd_query = CALLOC_STRUCT(dd_query); + if (dd_query) { + /* no special handling for batch queries yet */ + dd_query->type = query_types[0]; + dd_query->query = query; + query = (struct pipe_query *)dd_query; + } else { + pipe->destroy_query(pipe, query); + query = NULL; + } + } + + return query; +} + static void dd_context_destroy_query(struct pipe_context *_pipe, struct pipe_query *query) @@ -714,6 +740,7 @@ dd_context_create(struct dd_screen *dscreen, struct pipe_context *pipe) CTX_INIT(render_condition); CTX_INIT(create_query); + CTX_INIT(create_batch_query); CTX_INIT(destroy_query); CTX_INIT(begin_query); CTX_INIT(end_query); |