diff options
author | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2016-04-06 13:49:28 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2016-04-07 19:56:14 +0300 |
commit | a7cfa6f5ba350a920dadae23394c797742552c3f (patch) | |
tree | 7a60ce3970117bd9c2071a7aa41d96d80101f769 | |
parent | 4939196bc77b2ed2ffbe29e6a0dec9a60abb3855 (diff) |
Fixed crash on GPU buffer mapping.
-rw-r--r-- | drape/vertex_array_buffer.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drape/vertex_array_buffer.cpp b/drape/vertex_array_buffer.cpp index 59e171878c..52e436c3b8 100644 --- a/drape/vertex_array_buffer.cpp +++ b/drape/vertex_array_buffer.cpp @@ -78,7 +78,7 @@ void VertexArrayBuffer::RenderRange(IndicesRange const & range) { ASSERT(m_program != nullptr, ("Somebody not call Build. It's very bad. Very very bad")); /// if OES_vertex_array_object is supported than all bindings already saved in VAO - /// and we need only bind VAO. In Bind method have ASSERT("bind already called") + /// and we need only bind VAO. if (GLExtensionsList::Instance().IsSupported(GLExtensionsList::VertexArrayObject)) Bind(); else @@ -230,6 +230,11 @@ void VertexArrayBuffer::UploadIndexes(void const * data, uint32_t count) void VertexArrayBuffer::ApplyMutation(ref_ptr<IndexBufferMutator> indexMutator, ref_ptr<AttributeBufferMutator> attrMutator) { + /// If OES_vertex_array_object is supported than we need to bind current VAO before call glBindBuffer, + /// otherwise we could affect previously binded VAO. + if (GLExtensionsList::Instance().IsSupported(GLExtensionsList::VertexArrayObject)) + Bind(); + if (indexMutator != nullptr) { ASSERT(m_indexBuffer != nullptr, ()); |