gallium: adjust the query interface to support custom types
authorZack Rusin <zackr@vmware.com>
Thu, 3 Jun 2010 20:12:08 +0000 (16:12 -0400)
committerZack Rusin <zackr@vmware.com>
Tue, 8 Jun 2010 10:28:11 +0000 (06:28 -0400)
we need to change it to support composite types

12 files changed:
src/gallium/drivers/i965/brw_pipe_query.c
src/gallium/drivers/identity/id_context.c
src/gallium/drivers/llvmpipe/lp_query.c
src/gallium/drivers/nv50/nv50_query.c
src/gallium/drivers/nvfx/nvfx_query.c
src/gallium/drivers/r300/r300_query.c
src/gallium/drivers/r600/r600_query.c
src/gallium/drivers/rbug/rbug_context.c
src/gallium/drivers/softpipe/sp_query.c
src/gallium/drivers/svga/svga_pipe_query.c
src/gallium/drivers/trace/tr_context.c
src/gallium/include/pipe/p_context.h

index 2eb862635ccf6136c331d25c79575406618d2433..0745254c3cc66cdd2e10f2bff5594b65b5555484 100644 (file)
@@ -50,10 +50,11 @@ static boolean
 brw_query_get_result(struct pipe_context *pipe,
                     struct pipe_query *q,
                     boolean wait,
-                    uint64_t *result)
+                    void *vresult)
 {
    struct brw_context *brw = brw_context(pipe);
    struct brw_query_object *query = (struct brw_query_object *)q;
+   uint64_t *result = (uint64_t*)vresult;
 
    /* Map and count the pixels from the current query BO */
    if (query->bo) {
index 898e0b3af83b4fd3a7411dbb30aab3c533ad31b7..67be895b38592bf1a9a813d5824b287289d004e1 100644 (file)
@@ -158,7 +158,7 @@ static boolean
 identity_get_query_result(struct pipe_context *_pipe,
                           struct pipe_query *query,
                           boolean wait,
-                          uint64_t *result)
+                          void *result)
 {
    struct identity_context *id_pipe = identity_context(_pipe);
    struct pipe_context *pipe = id_pipe->pipe;
index c486442286028e905e035f1c8c4562463ce88cc9..c902c0468457333750cc0eb98092bd4aa9293743 100644 (file)
@@ -76,10 +76,11 @@ static boolean
 llvmpipe_get_query_result(struct pipe_context *pipe, 
                          struct pipe_query *q,
                          boolean wait,
-                         uint64_t *result )
+                         void *vresult)
 {
    struct llvmpipe_context *llvmpipe = llvmpipe_context( pipe );
    struct llvmpipe_query *pq = llvmpipe_query(q);
+   uint64_t *result = (uint64_t *)vresult;
 
    if (!pq->done) {
       lp_setup_flush(llvmpipe->setup, 0);
index 57b16a355dc1ff0bde3766aeb25ab13b84c08125..53f94820ce09479c66e15d466df122d1e065daff 100644 (file)
@@ -106,8 +106,9 @@ nv50_query_end(struct pipe_context *pipe, struct pipe_query *pq)
 
 static boolean
 nv50_query_result(struct pipe_context *pipe, struct pipe_query *pq,
-                 boolean wait, uint64_t *result)
+                 boolean wait, void *vresult)
 {
+       uint64_t *result = (uint64_t*)vresult;
        struct nv50_query *q = nv50_query(pq);
        int ret;
 
index 1b20b5245d7ff51c8e4f7cb2f8554791045d2153..1dab20c41a02ae4019123c117aa06a27cdd01211 100644 (file)
@@ -96,8 +96,9 @@ nvfx_query_end(struct pipe_context *pipe, struct pipe_query *pq)
 
 static boolean
 nvfx_query_result(struct pipe_context *pipe, struct pipe_query *pq,
-                 boolean wait, uint64_t *result)
+                 boolean wait, void *vresult)
 {
+       uint64_t *result = (uint64_t *)vresult;
        struct nvfx_context *nvfx = nvfx_context(pipe);
        struct nvfx_query *q = nvfx_query(pq);
 
index 97081c4a00f3fc24ac09cb6f4bda58869e76d844..7c088063683f81fbcff31742e91adb9b6dcd6c40 100644 (file)
@@ -114,7 +114,7 @@ static void r300_end_query(struct pipe_context* pipe,
 static boolean r300_get_query_result(struct pipe_context* pipe,
                                      struct pipe_query* query,
                                      boolean wait,
-                                     uint64_t* result)
+                                     void* vresult)
 {
     struct r300_context* r300 = r300_context(pipe);
     struct r300_screen* r300screen = r300->screen;
@@ -124,6 +124,7 @@ static boolean r300_get_query_result(struct pipe_context* pipe,
     uint32_t* map;
     uint32_t temp = 0;
     unsigned i, num_results;
+    uint64_t *result = (uint64_t*)vresult;
 
     if (q->flushed == FALSE)
         pipe->flush(pipe, 0, NULL);
index 24746e78771a1aafc540467b4a231469a766f658..9b02ae680e72b0704f6fd82a2d27a346da09aca0 100644 (file)
@@ -50,7 +50,7 @@ static void r600_end_query(struct pipe_context *pipe, struct pipe_query *query)
 
 static boolean r600_get_query_result(struct pipe_context *pipe,
                                        struct pipe_query *query,
-                                       boolean wait, uint64_t *result)
+                                       boolean wait, void *result)
 {
        return TRUE;
 }
index 164d811ab482faee52b14ac4ac0aa796422e0e5d..00b167e256c4c6f657efb6de22ee46dc56ae9189 100644 (file)
@@ -241,7 +241,7 @@ static boolean
 rbug_get_query_result(struct pipe_context *_pipe,
                       struct pipe_query *query,
                       boolean wait,
-                      uint64_t *result)
+                      void *result)
 {
    struct rbug_context *rb_pipe = rbug_context(_pipe);
    struct pipe_context *pipe = rb_pipe->pipe;
index b959af63aff59e6ebe8a24d4b18bb39a85664bd2..ae52c22b3ee6264a4db0e9dc29c6c5fdcdc3c5b9 100644 (file)
@@ -118,9 +118,10 @@ static boolean
 softpipe_get_query_result(struct pipe_context *pipe, 
                          struct pipe_query *q,
                          boolean wait,
-                         uint64_t *result )
+                         void *vresult)
 {
    struct softpipe_query *sq = softpipe_query(q);
+   uint64_t *result = (uint64_t*)vresult;
    *result = sq->end - sq->start;
    return TRUE;
 }
index 96fb4b8e5368a07e425c41af72c00bf94e32e5be..579f8034c7c8b45b5e658ac16c9ce089ac6a02ac 100644 (file)
@@ -63,7 +63,7 @@ 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 )
@@ -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__);
 
index 9ca916fe7b465644a3138e7f205408faaa56ddf7..55dd6cf8837396d6833840e6be7cbb4ba8a0d01e 100644 (file)
@@ -248,7 +248,7 @@ static INLINE boolean
 trace_context_get_query_result(struct pipe_context *_pipe,
                                struct pipe_query *query,
                                boolean wait,
-                               uint64_t *presult)
+                               void *presult)
 {
    struct trace_context *tr_ctx = trace_context(_pipe);
    struct pipe_context *pipe = tr_ctx->pipe;
@@ -260,7 +260,7 @@ trace_context_get_query_result(struct pipe_context *_pipe,
    trace_dump_arg(ptr, pipe);
 
    _result = pipe->get_query_result(pipe, query, wait, presult);
-   result = *presult;
+   result = *((uint64_t*)presult);
 
    trace_dump_arg(uint, result);
    trace_dump_ret(bool, _result);
index 74180888f6995b3d5edbb1b9e5901566dd9ec8b2..72afad60ba9a4d22e591b8b66fba4a876382a2aa 100644 (file)
@@ -135,10 +135,10 @@ struct pipe_context {
     * \param wait  if true, this query will block until the result is ready
     * \return TRUE if results are ready, FALSE otherwise
     */
-   boolean (*get_query_result)(struct pipe_context *pipe, 
+   boolean (*get_query_result)(struct pipe_context *pipe,
                                struct pipe_query *q,
                                boolean wait,
-                               uint64_t *result);
+                               void *result);
    /*@}*/
 
    /**