aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_cb_queryobj.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-07-11 11:56:57 +0200
committermarha <marha@users.sourceforge.net>2012-07-11 11:56:57 +0200
commit0bef135026040688be97af98cc99cc82f93838e8 (patch)
treee92b0a40e98bbd566e64ac507a5b3d2acf397c7b /mesalib/src/mesa/state_tracker/st_cb_queryobj.c
parentd137057fd13e83ec15ab416c7fe774741da06047 (diff)
downloadvcxsrv-0bef135026040688be97af98cc99cc82f93838e8.tar.gz
vcxsrv-0bef135026040688be97af98cc99cc82f93838e8.tar.bz2
vcxsrv-0bef135026040688be97af98cc99cc82f93838e8.zip
mesa xserver pixman git update 11 Jul 2012
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_cb_queryobj.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_queryobj.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_cb_queryobj.c b/mesalib/src/mesa/state_tracker/st_cb_queryobj.c
index b6a236e8d..e5e4a81dc 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_queryobj.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_queryobj.c
@@ -39,6 +39,7 @@
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
+#include "pipe/p_screen.h"
#include "st_context.h"
#include "st_cb_queryobj.h"
#include "st_cb_bitmap.h"
@@ -133,6 +134,11 @@ st_EndQuery(struct gl_context *ctx, struct gl_query_object *q)
st_flush_bitmap_cache(st_context(ctx));
+ if (q->Target == GL_TIMESTAMP && !stq->pq) {
+ stq->pq = pipe->create_query(pipe, PIPE_QUERY_TIMESTAMP);
+ stq->type = PIPE_QUERY_TIMESTAMP;
+ }
+
pipe->end_query(pipe, stq->pq);
}
@@ -169,6 +175,13 @@ st_CheckQuery(struct gl_context *ctx, struct gl_query_object *q)
}
+static uint64_t
+st_GetTimestamp(struct gl_context *ctx)
+{
+ struct pipe_screen *screen = st_context(ctx)->pipe->screen;
+
+ return screen->get_timestamp(screen);
+}
void st_init_query_functions(struct dd_function_table *functions)
@@ -179,6 +192,7 @@ void st_init_query_functions(struct dd_function_table *functions)
functions->EndQuery = st_EndQuery;
functions->WaitQuery = st_WaitQuery;
functions->CheckQuery = st_CheckQuery;
+ functions->GetTimestamp = st_GetTimestamp;
}
#endif /* FEATURE_queryobj */