mesa: Add a new QueryCounter() hook for TIMESTAMP queries.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 25 Feb 2013 19:21:17 +0000 (11:21 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 2 Mar 2013 06:09:03 +0000 (22:09 -0800)
commitdfb056b8926cff0f96cb181630092236ab0e8f81
treec57b6763270c75209ff23ddcd0a8f03d5a66d518
parent6ace2e41da7dded630d932d03bacb7e14a93d47a
mesa: Add a new QueryCounter() hook for TIMESTAMP queries.

In OpenGL, most queries record statistics about operations performed
between a defined beginning and ending point.  However, TIMESTAMP
queries are different: they immediately return a single value, and there
is no start/stop mechanism.

Previously, Mesa implemented TIMESTAMP queries by calling EndQuery
without first calling BeginQuery.  Apparently this is DirectX
convention, and Gallium followed suit.  I personally find the asymmetry
jarring, however---having BeginQuery and EndQuery handle a different set
of enum values looks like a bug.  It's also a bit confusing to mix the
one-shot query with the start/stop model.

So, add a new QueryCounter driver hook for implementing TIMESTAMP.  For
now, fall back to EndQuery to support drivers that don't do the new
mechanism.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/main/dd.h
src/mesa/main/queryobj.c