-
Notifications
You must be signed in to change notification settings - Fork 8
Description
The code currently checks the data passed to gl.bufferData
and gl.bufferSubData
if it's passed in a typed array. It can't check though if it's passed as an ArrayBuffer
. Even if it is passed in as a typed array that does not mean that's how it will be used (though if that's the case you really should probably pass it in as an ArrayBuffer to make it clear the data is untyped)
The code could check at render time, look up all the attributes, walk the buffers as specified, check for NaN. To do so in WebGL1 would require shadowing all the buffer data. In WebGL2 you could use getBufferSubData
. It would be hella slow but you can cache the results meaning you can come up with a signature of the attribute settings and if the buffers haven't changed, the attributes for the current vao haven't changed, and the vertex count hasn't changed then you don't need to check again.
I don't know how many bugs that would catch. Just something to consider