NUM_QUERIES);
pipe->destroy_query(pipe, info->query[info->head]);
info->query[info->head] =
- pipe->create_query(pipe, info->query_type);
+ pipe->create_query(pipe, info->query_type, 0);
}
else {
/* the last query is busy, we need to add a new one we can use
info->head = (info->head+1) % NUM_QUERIES;
if (!info->query[info->head]) {
info->query[info->head] =
- pipe->create_query(pipe, info->query_type);
+ pipe->create_query(pipe, info->query_type, 0);
}
}
break;
else {
/* initialize */
info->last_time = now;
- info->query[info->head] = pipe->create_query(pipe, info->query_type);
+ info->query[info->head] = pipe->create_query(pipe, info->query_type, 0);
pipe->begin_query(pipe, info->query[info->head]);
}
}
``destroy_query``. To start a query, use ``begin_query``, and when finished,
use ``end_query`` to end the query.
+``create_query`` takes a query type (``PIPE_QUERY_*``), as well as an index,
+which is the vertex stream for ``PIPE_QUERY_PRIMITIVES_GENERATED`` and
+``PIPE_QUERY_PRIMITIVES_EMITTED``, and allocates a query structure.
+
``begin_query`` will clear/reset previous query results.
``get_query_result`` is used to retrieve the results of a query. If
*/
static struct pipe_query *
-fd_create_query(struct pipe_context *pctx, unsigned query_type)
+fd_create_query(struct pipe_context *pctx, unsigned query_type, unsigned index)
{
struct fd_context *ctx = fd_context(pctx);
struct fd_query *q;
static struct pipe_query *
galahad_context_create_query(struct pipe_context *_pipe,
- unsigned query_type)
+ unsigned query_type,
+ unsigned index)
{
struct galahad_context *glhd_pipe = galahad_context(_pipe);
struct pipe_context *pipe = glhd_pipe->pipe;
}
return pipe->create_query(pipe,
- query_type);
+ query_type,
+ index);
}
static void
};
static struct pipe_query *i915_create_query(struct pipe_context *ctx,
- unsigned query_type)
+ unsigned query_type,
+ unsigned index)
{
struct i915_query *query = CALLOC_STRUCT( i915_query );
static struct pipe_query *
identity_create_query(struct pipe_context *_pipe,
- unsigned query_type)
+ unsigned query_type,
+ unsigned index)
{
struct identity_context *id_pipe = identity_context(_pipe);
struct pipe_context *pipe = id_pipe->pipe;
return pipe->create_query(pipe,
- query_type);
+ query_type,
+ index);
}
static void
}
static struct pipe_query *
-ilo_create_query(struct pipe_context *pipe, unsigned query_type)
+ilo_create_query(struct pipe_context *pipe, unsigned query_type, unsigned index)
{
struct ilo_query *q;
static struct pipe_query *
llvmpipe_create_query(struct pipe_context *pipe,
- unsigned type)
+ unsigned type,
+ unsigned index)
{
struct llvmpipe_query *pq;
struct noop_query {
unsigned query;
};
-static struct pipe_query *noop_create_query(struct pipe_context *ctx, unsigned query_type)
+static struct pipe_query *noop_create_query(struct pipe_context *ctx, unsigned query_type, unsigned index)
{
struct noop_query *query = CALLOC_STRUCT(noop_query);
}
static struct pipe_query *
-nv30_query_create(struct pipe_context *pipe, unsigned type)
+nv30_query_create(struct pipe_context *pipe, unsigned type, unsigned index)
{
struct nv30_query *q = CALLOC_STRUCT(nv30_query);
if (!q)
}
static struct pipe_query *
-nv50_query_create(struct pipe_context *pipe, unsigned type)
+nv50_query_create(struct pipe_context *pipe, unsigned type, unsigned index)
{
struct nv50_context *nv50 = nv50_context(pipe);
struct nv50_query *q;
if (nouveau_context(pipe)->screen->class_3d >= NVA0_3D_CLASS) {
targ->pq = pipe->create_query(pipe,
- NVA0_QUERY_STREAM_OUTPUT_BUFFER_OFFSET);
+ NVA0_QUERY_STREAM_OUTPUT_BUFFER_OFFSET, 0);
if (!targ->pq) {
FREE(targ);
return NULL;
}
static struct pipe_query *
-nvc0_query_create(struct pipe_context *pipe, unsigned type)
+nvc0_query_create(struct pipe_context *pipe, unsigned type, unsigned index)
{
struct nvc0_context *nvc0 = nvc0_context(pipe);
struct nvc0_query *q;
if (!targ)
return NULL;
- targ->pq = pipe->create_query(pipe, NVC0_QUERY_TFB_BUFFER_OFFSET);
+ targ->pq = pipe->create_query(pipe, NVC0_QUERY_TFB_BUFFER_OFFSET, 0);
if (!targ->pq) {
FREE(targ);
return NULL;
#include <stdio.h>
static struct pipe_query *r300_create_query(struct pipe_context *pipe,
- unsigned query_type)
+ unsigned query_type,
+ unsigned index)
{
struct r300_context *r300 = r300_context(pipe);
struct r300_screen *r300screen = r300->screen;
}
}
-static struct pipe_query *r600_create_query(struct pipe_context *ctx, unsigned query_type)
+static struct pipe_query *r600_create_query(struct pipe_context *ctx, unsigned query_type, unsigned index)
{
struct r600_common_context *rctx = (struct r600_common_context *)ctx;
struct r600_query *query;
static struct pipe_query *
rbug_create_query(struct pipe_context *_pipe,
- unsigned query_type)
+ unsigned query_type,
+ unsigned index)
{
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
pipe_mutex_lock(rb_pipe->call_mutex);
return pipe->create_query(pipe,
- query_type);
+ query_type,
+ index);
pipe_mutex_unlock(rb_pipe->call_mutex);
}
static struct pipe_query *
softpipe_create_query(struct pipe_context *pipe,
- unsigned type)
+ unsigned type,
+ unsigned index)
{
struct softpipe_query* sq;
static struct pipe_query *
-svga_create_query( struct pipe_context *pipe, unsigned query_type )
+svga_create_query(struct pipe_context *pipe,
+ unsigned query_type,
+ unsigned index)
{
struct svga_context *svga = svga_context( pipe );
struct svga_screen *svgascreen = svga_screen(pipe->screen);
static INLINE struct pipe_query *
trace_context_create_query(struct pipe_context *_pipe,
- unsigned query_type)
+ unsigned query_type,
+ unsigned index)
{
struct trace_context *tr_ctx = trace_context(_pipe);
struct pipe_context *pipe = tr_ctx->pipe;
trace_dump_arg(ptr, pipe);
trace_dump_arg(query_type, query_type);
+ trace_dump_arg(int, index);
- query = pipe->create_query(pipe, query_type);
+ query = pipe->create_query(pipe, query_type, index);
trace_dump_ret(ptr, query);
*/
/*@{*/
struct pipe_query *(*create_query)( struct pipe_context *pipe,
- unsigned query_type );
+ unsigned query_type,
+ unsigned index );
void (*destroy_query)(struct pipe_context *pipe,
struct pipe_query *q);
timestamp::query::query(command_queue &q) :
q(q),
- _query(q.pipe->create_query(q.pipe, PIPE_QUERY_TIMESTAMP)) {
+ _query(q.pipe->create_query(q.pipe, PIPE_QUERY_TIMESTAMP, 0)) {
}
timestamp::query::query(query &&other) :
PIPE_CLEAR_COLOR | PIPE_CLEAR_DEPTHSTENCIL,
&clear_color, 1.0, 0);
- q1 = info.ctx->create_query(info.ctx, PIPE_QUERY_OCCLUSION_COUNTER);
- q2 = info.ctx->create_query(info.ctx, PIPE_QUERY_OCCLUSION_COUNTER);
+ q1 = info.ctx->create_query(info.ctx, PIPE_QUERY_OCCLUSION_COUNTER, 0);
+ q2 = info.ctx->create_query(info.ctx, PIPE_QUERY_OCCLUSION_COUNTER, 0);
/* draw first, large object */
set_vertices(obj1_vertices, sizeof(obj1_vertices));
def surface_destroy(self, surface):
self.interpreter.unregister_object(surface)
- def create_query(self, query_type):
+ def create_query(self, query_type, index):
return query_type
def destroy_query(self, query):
type == PIPE_QUERY_TIMESTAMP) {
/* Determine time elapsed by emitting two timestamp queries. */
if (!stq->pq_begin) {
- stq->pq_begin = pipe->create_query(pipe, type);
+ stq->pq_begin = pipe->create_query(pipe, type, 0);
stq->type = type;
}
pipe->end_query(pipe, stq->pq_begin);
} else {
if (!stq->pq) {
- stq->pq = pipe->create_query(pipe, type);
+ stq->pq = pipe->create_query(pipe, type, 0);
stq->type = type;
}
if (stq->pq) {
if ((q->Target == GL_TIMESTAMP ||
q->Target == GL_TIME_ELAPSED) &&
!stq->pq) {
- stq->pq = pipe->create_query(pipe, PIPE_QUERY_TIMESTAMP);
+ stq->pq = pipe->create_query(pipe, PIPE_QUERY_TIMESTAMP, 0);
stq->type = PIPE_QUERY_TIMESTAMP;
}