Remove tgsi_sse2.
[mesa.git] / src / gallium / drivers / svga / svga_pipe_query.c
index 01336b0a2c3ac5fdf9be0302241fbf28583df7bf..c44e0b8ec498af2a67d00a00d9ec4733695d9786 100644 (file)
@@ -30,9 +30,8 @@
 #include "svga_cmd.h"
 #include "svga_context.h"
 #include "svga_screen.h"
-#include "svga_screen_buffer.h"
+#include "svga_resource_buffer.h"
 #include "svga_winsys.h"
-#include "svga_draw.h"
 #include "svga_debug.h"
 
 
@@ -64,11 +63,12 @@ svga_query( struct pipe_query *q )
 static boolean svga_get_query_result(struct pipe_context *pipe, 
                                      struct pipe_query *q,
                                      boolean wait,
-                                     uint64_t *result);
+                                     void *result);
 
 static struct pipe_query *svga_create_query( struct pipe_context *pipe,
                                              unsigned query_type )
 {
+   struct svga_context *svga = svga_context( pipe );
    struct svga_screen *svgascreen = svga_screen(pipe->screen);
    struct svga_winsys_screen *sws = svgascreen->sws;
    struct svga_query *sq;
@@ -81,7 +81,7 @@ static struct pipe_query *svga_create_query( struct pipe_context *pipe,
 
    sq->type = SVGA3D_QUERYTYPE_OCCLUSION;
 
-   sq->hwbuf = svga_winsys_buffer_create(svgascreen, 
+   sq->hwbuf = svga_winsys_buffer_create(svga,
                                          1,
                                          SVGA_BUFFER_USAGE_PINNED,
                                          sizeof *sq->queryResult);
@@ -90,7 +90,7 @@ static struct pipe_query *svga_create_query( struct pipe_context *pipe,
     
    sq->queryResult = (SVGA3dQueryResult *)sws->buffer_map(sws, 
                                                           sq->hwbuf, 
-                                                          PIPE_BUFFER_USAGE_CPU_WRITE);
+                                                          PIPE_TRANSFER_WRITE);
    if(!sq->queryResult)
       goto no_query_result;
 
@@ -207,13 +207,14 @@ static void svga_end_query(struct pipe_context *pipe,
 static boolean svga_get_query_result(struct pipe_context *pipe, 
                                      struct pipe_query *q,
                                      boolean wait,
-                                     uint64_t *result)
+                                     void *vresult)
 {
    struct svga_context *svga = svga_context( pipe );
    struct svga_screen *svgascreen = svga_screen( pipe->screen );
    struct svga_winsys_screen *sws = svgascreen->sws;
    struct svga_query *sq = svga_query( q );
    SVGA3dQueryState state;
+   uint64_t *result = (uint64_t*)vresult;
    
    SVGA_DBG(DEBUG_QUERY, "%s wait: %d\n", __FUNCTION__);
 
@@ -240,7 +241,7 @@ static boolean svga_get_query_result(struct pipe_context *pipe,
       if(!wait)
          return FALSE;
    
-      sws->fence_finish(sws, sq->fence, 0);
+      sws->fence_finish(sws, sq->fence, SVGA_FENCE_FLAG_QUERY);
       
       state = sq->queryResult->state;
    }