summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/softpipe/sp_context.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2007-12-11 17:10:26 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2007-12-11 17:10:48 +0000
commit13699463a33c1adf44005125c488e886e074a05b (patch)
treecb9e0b85f96fd931f87d3b1fc813723013d2a2b7 /src/mesa/pipe/softpipe/sp_context.c
parentb247ab036327d66b8b9b1aff2dbcf4520ed0284f (diff)
downloadexternal_mesa3d-13699463a33c1adf44005125c488e886e074a05b.zip
external_mesa3d-13699463a33c1adf44005125c488e886e074a05b.tar.gz
external_mesa3d-13699463a33c1adf44005125c488e886e074a05b.tar.bz2
Rework gallium and mesa queries a little.
Add a 'CheckQuery()' driver callback to mesa to check query completion. Make pipe_query an opaque type. Rework softpipe queries, support overlapping occlusion queries.
Diffstat (limited to 'src/mesa/pipe/softpipe/sp_context.c')
-rw-r--r--src/mesa/pipe/softpipe/sp_context.c36
1 files changed, 2 insertions, 34 deletions
diff --git a/src/mesa/pipe/softpipe/sp_context.c b/src/mesa/pipe/softpipe/sp_context.c
index 7d243aa..107c8f8 100644
--- a/src/mesa/pipe/softpipe/sp_context.c
+++ b/src/mesa/pipe/softpipe/sp_context.c
@@ -42,6 +42,7 @@
#include "sp_tile_cache.h"
#include "sp_texture.h"
#include "sp_winsys.h"
+#include "sp_query.h"
@@ -150,37 +151,6 @@ static void softpipe_destroy( struct pipe_context *pipe )
}
-static void
-softpipe_begin_query(struct pipe_context *pipe, struct pipe_query_object *q)
-{
- struct softpipe_context *softpipe = softpipe_context( pipe );
- assert(q->type < PIPE_QUERY_TYPES);
- assert(!softpipe->queries[q->type]);
- softpipe->queries[q->type] = q;
-}
-
-
-static void
-softpipe_end_query(struct pipe_context *pipe, struct pipe_query_object *q)
-{
- struct softpipe_context *softpipe = softpipe_context( pipe );
- assert(q->type < PIPE_QUERY_TYPES);
- assert(softpipe->queries[q->type]);
- q->ready = 1; /* software rendering is synchronous */
- softpipe->queries[q->type] = NULL;
-}
-
-
-static void
-softpipe_wait_query(struct pipe_context *pipe, struct pipe_query_object *q)
-{
- /* Should never get here since we indicated that the result was
- * ready in softpipe_end_query().
- */
- assert(0);
-}
-
-
static const char *softpipe_get_name( struct pipe_context *pipe )
{
return "softpipe";
@@ -320,9 +290,7 @@ struct pipe_context *softpipe_create( struct pipe_winsys *pipe_winsys,
softpipe->pipe.clear = softpipe_clear;
softpipe->pipe.flush = softpipe_flush;
- softpipe->pipe.begin_query = softpipe_begin_query;
- softpipe->pipe.end_query = softpipe_end_query;
- softpipe->pipe.wait_query = softpipe_wait_query;
+ softpipe_init_query_funcs( softpipe );
/* textures */
softpipe->pipe.texture_create = softpipe_texture_create;