st/nine: Queries: return S_FALSE instead of INVALIDCALL when in building query state
authorAxel Davy <axel.davy@ens.fr>
Sun, 23 Nov 2014 10:44:59 +0000 (11:44 +0100)
committerAxel Davy <axel.davy@ens.fr>
Wed, 3 Dec 2014 15:39:24 +0000 (16:39 +0100)
It is the same behaviour as wine has.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
src/gallium/state_trackers/nine/query9.c

index 17c36e510fc1c6ba04ec7de9023eb4b27c9e6df8..b74a707e3f311e3ca73059c5198b4cdd3942c5bc 100644 (file)
@@ -205,7 +205,10 @@ NineQuery9_GetData( struct NineQuery9 *This,
     DBG("This=%p pData=%p dwSize=%d dwGetDataFlags=%d\n",
         This, pData, dwSize, dwGetDataFlags);
 
-    user_assert(This->state != NINE_QUERY_STATE_RUNNING, D3DERR_INVALIDCALL);
+    /* according to spec we should return D3DERR_INVALIDCALL here, but
+     * wine returns S_FALSE because it is apparently the behaviour
+     * on windows */
+    user_assert(This->state != NINE_QUERY_STATE_RUNNING, S_FALSE);
     user_assert(dwSize == 0 || pData, D3DERR_INVALIDCALL);
     user_assert(dwGetDataFlags == 0 ||
                 dwGetDataFlags == D3DGETDATA_FLUSH, D3DERR_INVALIDCALL);