pex-gl / pex-context

Modern WebGL state wrapper for PEX: allocate GPU resources (textures, buffers), setup state pipelines and passes, and combine them into commands.
http://pex-gl.github.io/pex-context/
MIT License
160 stars 12 forks source link

drawElements: attempt to access out of bounds arrays #7

Closed vorg closed 8 years ago

vorg commented 8 years ago

I had problems rendering meshes where i used shaders with and without aTexCoord0 due to VertexArray locations being left enabled.

We don't unbind the unused vertex array locations so i experimented with VertexArray._unbindInternal but ideally we would disable only the locations not used by the next VertexArray.

This wouldn't happen if we had draw commands with both shaders and vertex arrays present at the same place so we can compare what's used and what's provided. We could also optimize these cases on the fly by using VAOs is the VA/Program pair is used multiple times.