diff options
author | Xavier Bouchoux <[email protected]> | 2015-02-08 15:56:15 +0100 |
---|---|---|
committer | Axel Davy <[email protected]> | 2015-04-29 08:28:10 +0200 |
commit | 851abb91459b13d28303f54605b8da51c24efcb7 (patch) | |
tree | 7a82b04cab8bf7fb9d1a166f5388fb42882ac866 /src | |
parent | 31bb4cd5c6e3d696b2f240c270a257abfcd8848f (diff) |
st/nine: Fix D3DQUERYTYPE_TIMESTAMPFREQ query
D3DQUERYTYPE_TIMESTAMPFREQ is supposed to give the frequency
at which the clock of D3DQUERYTYPE_TIMESTAMP runs.
PIPE_QUERY_TIMESTAMP returns a value in ns, thus the corresponding
frequency is 1000000000.
PIPE_QUERY_TIMESTAMP_DISJOINT returns the frequency at which
PIPE_QUERY_TIMESTAMP value is updated. It isn't always
1000000000.
Reviewed-by: Axel Davy <[email protected]>
Signed-off-by: Xavier Bouchoux <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/state_trackers/nine/query9.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/nine/query9.c b/src/gallium/state_trackers/nine/query9.c index 466b4ba3f7c..df49340b2cf 100644 --- a/src/gallium/state_trackers/nine/query9.c +++ b/src/gallium/state_trackers/nine/query9.c @@ -254,7 +254,15 @@ NineQuery9_GetData( struct NineQuery9 *This, nresult.b = presult.timestamp_disjoint.disjoint; break; case D3DQUERYTYPE_TIMESTAMPFREQ: - nresult.u64 = presult.timestamp_disjoint.frequency; + /* Applications use it to convert the TIMESTAMP value to time. + AMD drivers on win seem to return the actual hardware clock + resolution and corresponding values in TIMESTAMP. + However, this behaviour is not easy to replicate here. + So instead we do what wine and opengl do, and use + nanoseconds TIMESTAMPs. + (Which is also the unit used by PIPE_QUERY_TIMESTAMP.) + */ + nresult.u64 = 1000000000; break; case D3DQUERYTYPE_VERTEXSTATS: nresult.vertexstats.NumRenderedTriangles = |