diff options
-rw-r--r-- | src/mesa/main/dd.h | 1 | ||||
-rw-r--r-- | src/mesa/main/queryobj.c | 11 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 49071162617..4860d4d1235 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -638,6 +638,7 @@ struct dd_function_table { struct gl_query_object * (*NewQueryObject)(struct gl_context *ctx, GLuint id); void (*DeleteQuery)(struct gl_context *ctx, struct gl_query_object *q); void (*BeginQuery)(struct gl_context *ctx, struct gl_query_object *q); + void (*QueryCounter)(struct gl_context *ctx, struct gl_query_object *q); void (*EndQuery)(struct gl_context *ctx, struct gl_query_object *q); void (*CheckQuery)(struct gl_context *ctx, struct gl_query_object *q); void (*WaitQuery)(struct gl_context *ctx, struct gl_query_object *q); diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c index d0c5a2543fe..f0db740fdc3 100644 --- a/src/mesa/main/queryobj.c +++ b/src/mesa/main/queryobj.c @@ -486,9 +486,14 @@ _mesa_QueryCounter(GLuint id, GLenum target) q->Result = 0; q->Ready = GL_FALSE; - /* QueryCounter is implemented using EndQuery without BeginQuery - * in drivers. This is actually Direct3D and Gallium convention. */ - ctx->Driver.EndQuery(ctx, q); + if (ctx->Driver.QueryCounter) { + ctx->Driver.QueryCounter(ctx, q); + } else { + /* QueryCounter is implemented using EndQuery without BeginQuery + * in drivers. This is actually Direct3D and Gallium convention. + */ + ctx->Driver.EndQuery(ctx, q); + } } |