[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Public WebGL] drawArrays/drawElements validation cost query
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?