diff options
author | Chris Loer <chris.loer@gmail.com> | 2017-11-08 13:05:14 -0800 |
---|---|---|
committer | Chris Loer <chris.loer@mapbox.com> | 2017-11-08 13:33:47 -0800 |
commit | 7fceec2a1fdb685e6895688037749e696a6ba579 (patch) | |
tree | 4e04288f53f4c88ebff3df9736a6d5089f0645f1 | |
parent | 0f4eed2959f7741ccf73dd79297b5fe17ff23829 (diff) | |
download | qtlocation-mapboxgl-7fceec2a1fdb685e6895688037749e696a6ba579.tar.gz |
Unbind VAO before binding a GL_ELEMENT_ARRAY_BUFFER.
Fixes the native equivalent of gl-js issue #5620.
-rw-r--r-- | src/mbgl/gl/context.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp index b4be982be4..69b54c6e71 100644 --- a/src/mbgl/gl/context.cpp +++ b/src/mbgl/gl/context.cpp @@ -237,6 +237,9 @@ UniqueBuffer Context::createIndexBuffer(const void* data, std::size_t size, cons } void Context::updateIndexBuffer(UniqueBuffer& buffer, const void* data, std::size_t size) { + // Be sure to unbind any existing vertex array object before binding the index buffer + // so that we don't mess up another VAO + bindVertexArray = 0; globalVertexArrayState.indexBuffer = buffer; MBGL_CHECK_ERROR(glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, size, data)); } |