SpriteBatches/Text objects/ParticleSystems: use glBufferData+glBufferSubData instead of glBufferData+glBufferData for orphaning streaming vertex data, on most platforms. Apparently some Android drivers have a problem with the latter.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2017-09-03 23:41:35 -03:00
parent 362013d3ec
commit b6ecdb7c78
+9 -2
View File
@@ -101,8 +101,15 @@ void Buffer::unmapStream()
// "orphan" current buffer to avoid implicit synchronisation on the GPU:
// http://www.seas.upenn.edu/~pcozzi/OpenGLInsights/OpenGLInsights-AsynchronousBufferTransfers.pdf
gl.bindBuffer(type, vbo);
glBufferData(target, (GLsizeiptr) getSize(), nullptr, glusage);
glBufferData(target, (GLsizeiptr) getSize(), memory_map, glusage);
glBufferData(target, (GLsizeiptr) getSize(), nullptr, glusage);
#if LOVE_WINDOWS
// TODO: Verify that this codepath is a useful optimization.
if (gl.getVendor() == OpenGL::VENDOR_INTEL)
glBufferData(target, (GLsizeiptr) getSize(), memory_map, glusage);
else
#endif
glBufferSubData(target, 0, (GLsizeiptr) getSize(), memory_map);
}
void Buffer::unmap()