KhronosGroup/WebGL — pull request #451 by imzet (2014-01-21 16:14:20+00:00)
Title: additional check to make sure that vertexAttribPointer isn't called for ...

Some implementations can optimize out unused attributes (` getAttribLocation` returns `-1` for optimized out attributes). For example in test `tests/conformance/more/functions/uniformf.html` attribute `Tex` potentially could be optimized out (one can note that only the Z component of `texCoord0` is used in fragment shader, while Tex attribute is set into XY of `texCoord0` variable therefore `Tex` is unneeded):

```

```

Currently, classes from `utils.js` don't check for situation when ` getAttribLocation` returns `-1`. In particular `use` function in `VBO` class will try to invoke `vertexAttribPointer` function with `-1` as `indx` parameter what will result in INVALID_VALUE error. Attached fix will prevent from doing so.