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

Re: [Public WebGL] drawArrays/drawElements validation cost query

I've encountered exactly the same performance experiences when using draw calls such as drawElements. I’m all for anything that could help the GL developer get more information from the underlying implementation in order to better understand what’s going on in these situations.

James Bedford

On 11 Mar 2014, at 11:44, Florian Bösch <pyalot@gmail.com> wrote:

It's come up in another thread that ARB_robustness doesn't appear to make strong guarantees about range and index checking.

I've encountered numerous situations where seemingly inexplicably drawElements would suddenly destroy performance. In each of these cases it was that an author of WebGL code inadvertently did something to the configuration of pointers and draw parameters that caused repeated revalidation every frame.

Other than closely watching the performance for every change made, it's so far impossible to detect when you'd run into this situation. The rules for range checks are somewhat complex, and they're not made easier by extensions such as instanced drawing and uint indices.

I'd like to inquire if there's a possibility to get a method on a webgl context that can tell a developer if a revalidation would occur before the draw command is issued.

That way the assumption of a developer of revalidation could be checked, to see if it lines up with the user agents actual behavior, and errors in this area could be detected easier. For instance something like:

gl.drawWouldValidateVertexData() // true | false

Opinions on this?