r300g: read occlusion query results from both Z pipes on RV530
authorMarek Olšák <maraeo@gmail.com>
Mon, 26 Oct 2009 00:47:55 +0000 (01:47 +0100)
committerJoakim Sindholt <opensource@zhasha.com>
Mon, 26 Oct 2009 01:07:32 +0000 (02:07 +0100)
src/gallium/drivers/r300/r300_query.c

index 007f11efae61f8906079f15ab8dc3ef4a85be6ae..ca00b043c51d85dab138eb1998387d688154ce9e 100644 (file)
@@ -113,7 +113,7 @@ static boolean r300_get_query_result(struct pipe_context* pipe,
     unsigned flags = PIPE_BUFFER_USAGE_CPU_READ;
     uint32_t* map;
     uint32_t temp = 0;
-    unsigned i;
+    unsigned i, num_results;
 
     if (q->flushed == FALSE)
         pipe->flush(pipe, 0, NULL);
@@ -125,7 +125,13 @@ static boolean r300_get_query_result(struct pipe_context* pipe,
     if (!map)
         return FALSE;
     map += q->offset / 4;
-    for (i = 0; i < r300screen->caps->num_frag_pipes; i++) {
+
+    if (r300screen->caps->family == CHIP_FAMILY_RV530)
+        num_results = r300screen->caps->num_z_pipes;
+    else
+        num_results = r300screen->caps->num_frag_pipes;
+
+    for (i = 0; i < num_results; i++) {
         if (*map == ~0U) {
             /* Looks like our results aren't ready yet. */
             if (wait) {