[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] For review: ANGLE_timer_query extension

On Fri, Apr 12, 2013 at 10:18 PM, Rémi Arnaud <jsremi@gmail.com> wrote:
I don't belive this to be true. 

 A timer is a resource allocated in the driver. There are multiple queues involved until a command hits the driver. Such as JS process -> GPU process -> driver process. The queue we're measuring with query objects is the execution queue in the driver. This queue runs down on flip. The queue is processed one command at a time, such as drawArrays, useShader etc. Some commands force a queue synchronization such as texImage2D, bufferData, readPixels and finish.

So while the driver is processing the queue it encounters the query timer commands. When it hits one, it stores the value in the query object it has allocated. Since by definition the queue for a frame is empty by the time flip returns, any timer query that mattered to that frame has now been filled with a timing value and its flag of "readyness" been set. Therefore all preceeding timer queries have the flag set as well, and are equally filled with a value.

Hence the last query in a frame is the only query that needs to be polled to know if all preceeding queries of a frame are ready and filled with timing values.