From a7cfa6f5ba350a920dadae23394c797742552c3f Mon Sep 17 00:00:00 2001 From: Daria Volvenkova Date: Wed, 6 Apr 2016 13:49:28 +0300 Subject: Fixed crash on GPU buffer mapping. --- drape/vertex_array_buffer.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'drape/vertex_array_buffer.cpp') 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 indexMutator, ref_ptr 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, ()); -- cgit v1.2.3