mirror of
https://github.com/love2d/love.git
synced 2026-08-14 10:13:46 +02:00
macOS: Use a (non-persistent) map/sync approach for stream buffers, instead of glBufferSubData. This usually won't affect performance either way, but avoids some worst-case performance cliffs on my Intel GPU in my testing.
This commit is contained in:
@@ -485,6 +485,16 @@ love::graphics::StreamBuffer *CreateStreamBuffer(BufferType mode, size_t size)
|
||||
return new StreamBufferPinnedMemory(mode, size);
|
||||
else if (GLAD_VERSION_4_4 || GLAD_ARB_buffer_storage)
|
||||
return new StreamBufferPersistentMapSync(mode, size);
|
||||
|
||||
// Most modern drivers have a separate internal thread which queues
|
||||
// GL commands for the GPU. The queue causes mapping to stall until
|
||||
// the items in the queue are flushed, which makes this approach
|
||||
// slow on most drivers. On macOS, having a separate driver thread
|
||||
// is opt-in via an API, and we don't do it, so we can use this
|
||||
// instead of the (potentially slower) SubData approach.
|
||||
#ifdef LOVE_MACOSX
|
||||
return new StreamBufferMapSync(mode, size);
|
||||
#endif
|
||||
}
|
||||
|
||||
return new StreamBufferSubDataOrphan(mode, size);
|
||||
|
||||
Reference in New Issue
Block a user