st/nine: Queries: Always return D3D_OK when issuing with D3DISSUE_BEGIN
authorAxel Davy <axel.davy@ens.fr>
Mon, 24 Nov 2014 22:32:18 +0000 (23:32 +0100)
committerAxel Davy <axel.davy@ens.fr>
Wed, 3 Dec 2014 15:39:24 +0000 (16:39 +0100)
This is the behaviour that Wine tests.

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

index 937255667becc57fea0c07af58694541ea31db4b..6df4ead08c45c7c01543c1e7eea5e1bb178e7e73 100644 (file)
@@ -163,10 +163,15 @@ NineQuery9_Issue( struct NineQuery9 *This,
 
     DBG("This=%p dwIssueFlags=%d\n", This, dwIssueFlags);
 
-    user_assert((dwIssueFlags == D3DISSUE_BEGIN && !This->instant) ||
+    user_assert((dwIssueFlags == D3DISSUE_BEGIN) ||
                 (dwIssueFlags == 0) ||
                 (dwIssueFlags == D3DISSUE_END), D3DERR_INVALIDCALL);
 
+    /* Wine tests: always return D3D_OK on D3DISSUE_BEGIN
+     * even when the call is supposed to be forbidden */
+    if (dwIssueFlags == D3DISSUE_BEGIN && This->instant)
+        return D3D_OK;
+
     if (dwIssueFlags == D3DISSUE_BEGIN) {
         if (This->state == NINE_QUERY_STATE_RUNNING) {
         pipe->end_query(pipe, This->pq);