Skip to content

glGetAttribLocation produces exception in WebGL 2.0 #14589

@vkaytsanov

Description

@vkaytsanov

Setting the vertex attribute index in WebGL 2.0 Context via glGetAttribLocation produces the following error, when using two VertexBuffers in a single VertexArrayObject (VAO): exception thrown: TypeError: cb is undefined,_glEnableVertexAttribArray@

In OpenGLES 3.0 environment it doesn't crash.
A workaround is using glBindAttribLocation as described in the following commit.

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 2.0.18
clang version 13.0.0 (Cswircachegitchromium.googlesource.com-external-github.com-llvm-llvm--project 94340dd5bb23fb7c4bc7d91d5ac0608eb25660a8)
Target: wasm32-unknown-emscripten
Thread model: posix

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions