mirror of https://github.com/bjornbytes/lovr.git
More mapping fixes;
This commit is contained in:
parent
440b30df59
commit
8d1b335da4
|
@ -1613,15 +1613,14 @@ void lovrBufferUnmap(Buffer* buffer) {
|
|||
glBufferSubData(convertBufferType(buffer->type), buffer->flushFrom, buffer->flushTo - buffer->flushFrom, data);
|
||||
}
|
||||
#else
|
||||
if (buffer->flushTo > buffer->flushFrom) {
|
||||
if (buffer->flushTo > buffer->flushFrom && (GLAD_GL_ARB_buffer_storage || buffer->mapped)) {
|
||||
lovrGpuBindBuffer(buffer->type, buffer->id);
|
||||
glFlushMappedBufferRange(convertBufferType(buffer->type), buffer->flushFrom, buffer->flushTo - buffer->flushFrom);
|
||||
}
|
||||
|
||||
if (!GLAD_GL_ARB_buffer_storage && buffer->mapped) {
|
||||
lovrGpuBindBuffer(buffer->type, buffer->id);
|
||||
glUnmapBuffer(convertBufferType(buffer->type));
|
||||
buffer->mapped = false;
|
||||
if (buffer->mapped) {
|
||||
glUnmapBuffer(convertBufferType(buffer->type));
|
||||
buffer->mapped = false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
buffer->flushFrom = SIZE_MAX;
|
||||
|
|
Loading…
Reference in New Issue