Set unsynchronized bit in transparent pass

This commit is contained in:
vlj 2014-08-14 16:29:59 +02:00
parent 1c7fe8c518
commit 18981ff943

View File

@ -119,7 +119,10 @@ void STKAnimatedMesh::render()
glBindVertexArray(0);
size_t size = mb->getVertexCount() * GLmeshes[i].Stride;
glBindBuffer(GL_ARRAY_BUFFER, getVBO(mb->getVertexType()));
void * buf = glMapBufferRange(GL_ARRAY_BUFFER, GLmeshes[i].vaoBaseVertex * GLmeshes[i].Stride, size, GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_RANGE_BIT);
GLbitfield bitfield = GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_RANGE_BIT;
if (irr_driver->getPhase() == TRANSPARENT_PASS)
bitfield |= GL_MAP_UNSYNCHRONIZED_BIT;
void * buf = glMapBufferRange(GL_ARRAY_BUFFER, GLmeshes[i].vaoBaseVertex * GLmeshes[i].Stride, size, bitfield);
memcpy(buf, mb->getVertices(), size);
glUnmapBuffer(GL_ARRAY_BUFFER);
glBindBuffer(GL_ARRAY_BUFFER, 0);