Skip to content

check buffers interpreted by attributes? #4

@greggman

Description

@greggman

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions