Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaria Volvenkova <d.volvenkova@corp.mail.ru>2016-04-06 13:49:28 +0300
committerAlex Zolotarev <alex@maps.me>2016-04-07 19:56:14 +0300
commita7cfa6f5ba350a920dadae23394c797742552c3f (patch)
tree7a60ce3970117bd9c2071a7aa41d96d80101f769 /drape/vertex_array_buffer.cpp
parent4939196bc77b2ed2ffbe29e6a0dec9a60abb3855 (diff)
Fixed crash on GPU buffer mapping.
Diffstat (limited to 'drape/vertex_array_buffer.cpp')
-rw-r--r--drape/vertex_array_buffer.cpp7
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, ());