Merge branch 'master' into r300-compiler
[mesa.git] / src / gallium / drivers / softpipe / sp_query.c
index 2106ee1d235e7a982bdc071b1e7ba4dfe5dc3d53..379cf4ad064d201f35d12bea4e8b7bf53a001a98 100644 (file)
 
 #include "draw/draw_context.h"
 #include "pipe/p_defines.h"
-#include "pipe/p_inlines.h"
 #include "util/u_memory.h"
 #include "sp_context.h"
 #include "sp_query.h"
+#include "sp_state.h"
 
 struct softpipe_query {
-   uint64 start;
-   uint64 end;
+   uint64_t start;
+   uint64_t end;
 };
 
 
@@ -70,6 +70,8 @@ softpipe_begin_query(struct pipe_context *pipe, struct pipe_query *q)
    struct softpipe_query *sq = softpipe_query(q);
    
    sq->start = softpipe->occlusion_count;
+   softpipe->active_query_count++;
+   softpipe->dirty |= SP_NEW_QUERY;
 }
 
 
@@ -79,7 +81,9 @@ softpipe_end_query(struct pipe_context *pipe, struct pipe_query *q)
    struct softpipe_context *softpipe = softpipe_context( pipe );
    struct softpipe_query *sq = softpipe_query(q);
 
+   softpipe->active_query_count--;
    sq->end = softpipe->occlusion_count;
+   softpipe->dirty |= SP_NEW_QUERY;
 }
 
 
@@ -87,7 +91,7 @@ static boolean
 softpipe_get_query_result(struct pipe_context *pipe, 
                          struct pipe_query *q,
                          boolean wait,
-                         uint64 *result )
+                         uint64_t *result )
 {
    struct softpipe_query *sq = softpipe_query(q);
    *result = sq->end - sq->start;