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

Don't call disableVertexAttribArray unless necessary #58

Open vorg opened 5 years ago

vorg commented 5 years ago

In https://github.com/pex-gl/pex-context/blob/master/index.js#L695 we do

     for (let i = 0; i < 16; i++) {
        state.activeAttributes[i] = null
        gl.disableVertexAttribArray(i)
      }

while https://kripken.github.io/emscripten-site/docs/optimizing/Optimizing-WebGL.html#avoid-redundant-calls explicitly says to avoid it