summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2014-12-02 21:56:51 +0100
committerAxel Davy <[email protected]>2014-12-03 16:39:24 +0100
commit225d7f8e0ecf875ded0f1a42133995b2d2248cf5 (patch)
tree6700d42db4b6ebe0eedd52b1c0b89fcdfc8c9eef
parenteac0b9b68a14719be01bbabd8d3807d81694685b (diff)
st/nine: Queries: allow app to call GetData without Issuing first
Nine was allowing that behaviour, but was not filling the result. Tested-by: David Heidelberg <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Axel Davy <[email protected]>
-rw-r--r--src/gallium/state_trackers/nine/query9.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gallium/state_trackers/nine/query9.c b/src/gallium/state_trackers/nine/query9.c
index 1656ed31028..9d74ab8fad9 100644
--- a/src/gallium/state_trackers/nine/query9.c
+++ b/src/gallium/state_trackers/nine/query9.c
@@ -199,7 +199,7 @@ NineQuery9_GetData( struct NineQuery9 *This,
DWORD dwGetDataFlags )
{
struct pipe_context *pipe = This->base.device->pipe;
- boolean ok;
+ boolean ok, wait_query_result = FALSE;
unsigned i;
union pipe_query_result presult;
union nine_query_result nresult;
@@ -215,13 +215,18 @@ NineQuery9_GetData( struct NineQuery9 *This,
user_assert(dwGetDataFlags == 0 ||
dwGetDataFlags == D3DGETDATA_FLUSH, D3DERR_INVALIDCALL);
- if (This->state == NINE_QUERY_STATE_FRESH)
- return S_OK;
+ if (This->state == NINE_QUERY_STATE_FRESH) {
+ /* App forgot calling Issue. call it for it.
+ * However Wine states that return value should
+ * be S_OK, so wait for the result to return S_OK. */
+ NineQuery9_Issue(This, D3DISSUE_END);
+ wait_query_result = TRUE;
+ }
/* Note: We ignore dwGetDataFlags, because get_query_result will
* flush automatically if needed */
- ok = pipe->get_query_result(pipe, This->pq, FALSE, &presult);
+ ok = pipe->get_query_result(pipe, This->pq, wait_query_result, &presult);
if (!ok) return S_FALSE;