A few Gallium queries don't need and it's invalid to call begin_query.
Those are PIPE_QUERY_GPU_FINISHED (D3DQUERYTYPE_EVENT) and
PIPE_QUERY_TIMESTAMP (D3DQUERYTYPE_TIMESTAMP).

The attached patch should fix this.

Marek

On Sat, Nov 22, 2014 at 9:48 AM, John Ettedgui <john.etted...@gmail.com> wrote:
> So I tried both code you thought of.
>
> 1) Always having end_query did not seem to get a different behavior from my
> patch. (I'm sure it does somewhere but I didn't see that in my quick test).
>
> 2) Your 2nd code is more problematic (adding the begin_query as needed)
> The game completely dies/freezes, and I see this in the log:
> "r600_query.c:444:r600_begin_query: Assertion `0' failed."
> (I have a radeon card).
> The assert comes from this if statement:
> "if (!r600_query_needs_begin(rquery->type)) "
> Logically I'd say it means that we are running a query_begin when it is not
> needed.
> The query type is 8 if that helps.
>
> Now there are 2 cases:
> 1- the radeon code is correct and so we should not add that extra
> begin_query
> 2- the radeon code is incorrect and maybe adding this query_begin is right.
>   The i915's code does not do anything for begin or end, so hard to compare
> there.
>   The svga code switches on the query type, and will assert on the wrong
> ones. I guess it is similar to the radeon's.
>   Nouveau also has switches on type, but it does not error on "wrong ones".
>
> What do you think?
>
> John
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
From 7ea5cee75dcc4435164a0f776a1243123ea90760 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= <marek.ol...@amd.com>
Date: Sun, 23 Nov 2014 11:42:42 +0100
Subject: [PATCH] st/nine: handle queries without begin

---
 src/gallium/state_trackers/nine/query9.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/gallium/state_trackers/nine/query9.c b/src/gallium/state_trackers/nine/query9.c
index 86762d2..a7d08fa 100644
--- a/src/gallium/state_trackers/nine/query9.c
+++ b/src/gallium/state_trackers/nine/query9.c
@@ -186,10 +186,11 @@ NineQuery9_Issue( struct NineQuery9 *This,
         pipe->begin_query(pipe, This->pq);
         This->state = NINE_QUERY_STATE_RUNNING;
     } else {
-        if (This->state == NINE_QUERY_STATE_RUNNING) {
-            pipe->end_query(pipe, This->pq);
-            This->state = NINE_QUERY_STATE_ENDED;
-	}
+        if (This->state != NINE_QUERY_STATE_RUNNING && !This->instant)
+            return D3D_OK;
+
+        pipe->end_query(pipe, This->pq);
+        This->state = NINE_QUERY_STATE_ENDED;
     }
     return D3D_OK;
 }
-- 
1.8.4.msysgit.0

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to