mesa/st: Implement GL_TIME_ELAPSED w/ PIPE_QUERY_TIMESTAMP.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Sun, 9 Dec 2012 10:08:13 +0000 (10:08 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Thu, 20 Dec 2012 16:33:49 +0000 (16:33 +0000)
commit3160b0b9fc2b49b0e9fe684b955eebf3691024ff
tree8125293ed921fa635998dbaefe99d639af7cb609
parent9976216bf699be092e14b66ba3a3ecfa3859e87f
mesa/st: Implement GL_TIME_ELAPSED w/ PIPE_QUERY_TIMESTAMP.

ARB/EXT_timer_query's definition of GL_TIME_ELAPSED match precisely the
subtraction of two GL_TIMESTAMP queries.

And for a lot of drivers, that's precisely how they have to implement
internally -- by emitting two hardware timestamp queries.

So, to simplify driver implementation, simply allow doing so in the state
tracker.

Eventually if no driver implements PIPE_QUERY_TIME_ELAPSED then we could
retire it.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/state_tracker/st_cb_queryobj.c
src/mesa/state_tracker/st_cb_queryobj.h
src/mesa/state_tracker/st_context.h
src/mesa/state_tracker/st_extensions.c