}
}
-static boolean r600_query_hw_begin(struct r600_common_context *, struct r600_query *);
-static void r600_query_hw_end(struct r600_common_context *, struct r600_query *);
-static boolean r600_query_hw_get_result(struct r600_common_context *,
- struct r600_query *, boolean wait,
- union pipe_query_result *result);
-
static struct r600_query_ops query_hw_ops = {
.destroy = r600_query_hw_destroy,
.begin = r600_query_hw_begin,
.add_result = r600_query_hw_add_result,
};
+boolean r600_query_hw_init(struct r600_common_context *rctx,
+ struct r600_query_hw *query)
+{
+ query->buffer.buf = r600_new_query_buffer(rctx, query);
+ if (!query->buffer.buf)
+ return FALSE;
+
+ return TRUE;
+}
+
static struct pipe_query *r600_query_hw_create(struct r600_common_context *rctx,
unsigned query_type,
unsigned index)
return NULL;
}
- query->buffer.buf = r600_new_query_buffer(rctx, query);
- if (!query->buffer.buf) {
+ if (!r600_query_hw_init(rctx, query)) {
FREE(query);
return NULL;
}
return rquery->ops->begin(rctx, rquery);
}
-static boolean r600_query_hw_begin(struct r600_common_context *rctx,
- struct r600_query *rquery)
+boolean r600_query_hw_begin(struct r600_common_context *rctx,
+ struct r600_query *rquery)
{
struct r600_query_hw *query = (struct r600_query_hw *)rquery;
struct r600_query_buffer *prev = query->buffer.previous;
rquery->ops->end(rctx, rquery);
}
-static void r600_query_hw_end(struct r600_common_context *rctx,
+void r600_query_hw_end(struct r600_common_context *rctx,
struct r600_query *rquery)
{
struct r600_query_hw *query = (struct r600_query_hw *)rquery;
util_query_clear_result(result, query->b.type);
}
-static boolean r600_query_hw_get_result(struct r600_common_context *rctx,
- struct r600_query *rquery,
- boolean wait, union pipe_query_result *result)
+boolean r600_query_hw_get_result(struct r600_common_context *rctx,
+ struct r600_query *rquery,
+ boolean wait, union pipe_query_result *result)
{
struct r600_query_hw *query = (struct r600_query_hw *)rquery;
struct r600_query_buffer *qbuf;
unsigned stream;
};
+boolean r600_query_hw_init(struct r600_common_context *rctx,
+ struct r600_query_hw *query);
void r600_query_hw_destroy(struct r600_common_context *rctx,
struct r600_query *rquery);
+boolean r600_query_hw_begin(struct r600_common_context *rctx,
+ struct r600_query *rquery);
+void r600_query_hw_end(struct r600_common_context *rctx,
+ struct r600_query *rquery);
+boolean r600_query_hw_get_result(struct r600_common_context *rctx,
+ struct r600_query *rquery,
+ boolean wait,
+ union pipe_query_result *result);
#endif /* R600_QUERY_H */