diff options
author | Rob Clark <[email protected]> | 2016-02-14 09:59:41 -0500 |
---|---|---|
committer | Rob Clark <[email protected]> | 2016-02-17 10:41:55 -0500 |
commit | 62fa868728c729152af0d7cecd1d3e47e831cb7d (patch) | |
tree | 9539628de9b069748ef79a6326fcdddc3b3ab792 /src/gallium/drivers/freedreno | |
parent | 87eb4067912921ee3a260792b82fa5d4501ae8a9 (diff) |
freedreno/a4xx: better occlusion/sample counting
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 <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno')
-rw-r--r-- | src/gallium/drivers/freedreno/a4xx/fd4_query.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_query.c b/src/gallium/drivers/freedreno/a4xx/fd4_query.c index 4f69e0c1694..a1fafbc6128 100644 --- a/src/gallium/drivers/freedreno/a4xx/fd4_query.c +++ b/src/gallium/drivers/freedreno/a4xx/fd4_query.c @@ -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 |