summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine
diff options
context:
space:
mode:
authorXavier Bouchoux <[email protected]>2015-02-21 19:56:40 +0100
committerAxel Davy <[email protected]>2015-04-29 08:28:10 +0200
commitd838fe8243aa0e96b198c876c1b5d79c098d1c0d (patch)
tree4fad6c39a2ec31e1fff7c552e8b317bc3aebfa23 /src/gallium/state_trackers/nine
parent851abb91459b13d28303f54605b8da51c24efcb7 (diff)
st/nine: Improve D3DQUERYTYPE_TIMESTAMP
Avoid blocking when retrieving D3DQUERYTYPE_TIMESTAMP result with NineQuery9_GetData(), when D3DGETDATA_FLUSH is not specified. This mimics Win behaviour and gives slightly better performance for some games. Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Xavier Bouchoux <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine')
-rw-r--r--src/gallium/state_trackers/nine/query9.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/nine/query9.c b/src/gallium/state_trackers/nine/query9.c
index df49340b2cf..04f4aadabba 100644
--- a/src/gallium/state_trackers/nine/query9.c
+++ b/src/gallium/state_trackers/nine/query9.c
@@ -227,8 +227,13 @@ NineQuery9_GetData( struct NineQuery9 *This,
wait_query_result = TRUE;
}
- /* Wine tests: D3DQUERYTYPE_TIMESTAMP always succeeds */
- wait_query_result |= This->type == D3DQUERYTYPE_TIMESTAMP;
+ /* The documention mentions no special case for D3DQUERYTYPE_TIMESTAMP.
+ * However Windows tests show that the query always succeeds when
+ * D3DGETDATA_FLUSH is specified. */
+ if (This->type == D3DQUERYTYPE_TIMESTAMP &&
+ (dwGetDataFlags & D3DGETDATA_FLUSH))
+ wait_query_result = TRUE;
+
/* Note: We ignore dwGetDataFlags, because get_query_result will
* flush automatically if needed */