So I tried both code you thought of.<div><br></div><div>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).</div><div><br></div><div>2) Your 2nd code is more problematic (adding the begin_query as needed)</div><div>The game completely dies/freezes, and I see this in the log:</div><div>"r600_query.c:444:r600_begin_query: Assertion `0' failed."</div><div>(I have a radeon card).</div><div>The assert comes from this if statement:</div><div>"if (!r600_query_needs_begin(rquery->type)) "</div><div>Logically I'd say it means that we are running a query_begin when it is not needed.</div><div>The query type is 8 if that helps.</div><div><br></div><div>Now there are 2 cases:</div><div>1- the radeon code is correct and so we should not add that extra begin_query</div><div>2- the radeon code is incorrect and maybe adding this query_begin is right.</div><div><span style="font-size:13.3333330154419px">  The i915's code does not do anything for begin or end, so hard to compare there.</span><br></div><div>  The svga code switches on the query type, and will assert on the wrong  ones. I guess it is similar to the radeon's.</div><div>  Nouveau also has switches on type, but it does not error on "wrong ones".</div><div><br></div><div>What do you think?</div><div><br></div><div>John</div>