OSDN Git Service

i965: Don't flush the batch immediately on EndQuery.
authorEric Anholt <eric@anholt.net>
Tue, 16 Oct 2012 18:13:49 +0000 (11:13 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 19 Oct 2012 18:47:01 +0000 (11:47 -0700)
commit1973845fbd0af05dc252ead57fae39d1f866dd9e
treef2bc9f4cfe5a35600d409bc183d5d5bbea398c27
parent804469c58d755dfa82085a0421de1671bf421f05
i965: Don't flush the batch immediately on EndQuery.

The theory I had when I wrote the code was that you wanted to minimize latency
on your queries because the app was going to ask soon.  Only, it turns out
that everybody batches up their queries and asks for the results later (often
after the next SwapBuffers!), so this was a pessimization.

Until now, I had no workload where it mattered enough to benchmark.  Recently
I started playing some Minecraft, which uses tons of queries to decide whether
to render chunks of the terrain.  For that app, avoiding the flush in the
query-generation loop improves performance 22.7% +/- 4.7% (n=3) on an apitrace
capture of it (confirmed in game by watching the fps meter found by pressing
F3, 15/16 -> 20/21 fps).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_queryobj.c