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

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



The possibility of exposing a way to skip the CPU index buffer checks is being investigated, there's going to be more discussion on that once a more concrete proposal is ready.

That being said, we're not likely to get rid of the index buffer checks in all situations, so this discussion is also relevant. However, whether the index buffer needs to be revalidated depends on how the browser has implemented the requirement to return INVALID_OPERATION when indices are out of range. There are a lot of potential ways to make it faster than the naive approach, and the return value of drawWouldValidateVertexData could thus vary between browsers or even be meaningless on certain kinds of implementations, like if a lot of caching was done when buffer data is changed. So I'd be hesitant to add something like this to the spec.

-Olli
________________________________________
From: owners-public_webgl@khronos.org [owners-public_webgl@khronos.org] On Behalf Of James Bedford [james_bedford@me.com]
Sent: Tuesday, March 11, 2014 1:26 PM
To: Florian Bösch
Cc: public webgl
Subject: 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
www.jamesbedford.eu/fractals<http://www.jamesbedford.eu/fractals>

On 11 Mar 2014, at 11:44, Florian Bösch <pyalot@gmail.com<mailto: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?


-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------