mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user