On Sat, Nov 22, 2014 at 1:45 AM, John Ettedgui <john.etted...@gmail.com> wrote: > On Fri Nov 21 2014 at 10:36:29 PM Ilia Mirkin <imir...@alum.mit.edu> wrote: >> >> Right, I figured as much. My point is that doing what I'm proposing >> there would allow such usage even though it is illegal based on the >> API description. >> > Alright. >> >> It requires a begin_query for some but not all queries. >> >> Perhaps the code should read like >> >> } else { >> if (This->state != NINE_QUERY_STATE_RUNNING) >> pipe->begin_query(pipe, This->pq); >> pipe->end_query(pipe, This->pq); >> This->state = NINE_QUERY_STATE_ENDED; >> } >> >> This seems like it would also take care of the Ended -> Ended >> transition which is supposed to restart the query. > > My understanding is that the End->End restart is only in the final state of > the query, so it shouldn't happen in the others. > Do you see that differently?
No, but it seems like my proposed code above handles all the situations... if it's in the Building state (aka 'RUNNING'), then it just executes end_query. If it's in any other state (i.e. FRESH, ENDED, or FLUSHED) it will start a query anew and flip back to the ENDED state (which roughly corresponds to Issued). I guess FRESH/FLUSHED correspond to 'Signaled', although ENDED can mean 'Signaled' as well since nothing changes the state if pipe->get_query_results succeeds. BTW, please note that I know exceedingly little about the d3d9 api -- I'm just going by the msdn page you linked to + knowledge of gallium. I could well have misunderstood something. Cheers, -ilia _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev