freedreno/a4xx: better occlusion/sample counting
authorRob Clark <robclark@freedesktop.org>
Sun, 14 Feb 2016 14:59:41 +0000 (09:59 -0500)
committerRob Clark <robclark@freedesktop.org>
Wed, 17 Feb 2016 15:41:55 +0000 (10:41 -0500)
This seems to give more reliable results.  More similar to what we do on
a3xx, although I think it breaks the a3xx theory that the four sets of
results map to each MRT (since we appear to still only have four sets on
a4xx).  The divide-by-two is a bit odd, but seems to be needed for some
reason.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/a4xx/fd4_query.c

index 4f69e0c169476a7df7cf5fef667ef8d306f88397..a1fafbc61283915002f195f8b15bda83edf43be2 100644 (file)
@@ -81,7 +81,12 @@ static uint64_t
 count_samples(const struct fd_rb_samp_ctrs *start,
                const struct fd_rb_samp_ctrs *end)
 {
-       return end->ctr[0] - start->ctr[0];
+       uint64_t n = 0;
+
+       for (unsigned i = 0; i < 16; i += 4)
+               n += end->ctr[i] - start->ctr[i];
+
+       return n / 2;
 }
 
 static void