mirror of
https://github.com/italicsjenga/rust_minifb.git
synced 2025-01-09 18:41:32 +11:00
Fixed block forever on macOS
This commit is contained in:
parent
0a72653310
commit
635e2a58e0
|
@ -173,14 +173,14 @@ uint32_t upper_power_of_two(uint32_t v) {
|
|||
const int buffer_width = m_draw_parameters->buffer_width;
|
||||
const int buffer_height = m_draw_parameters->buffer_height;
|
||||
|
||||
// Wait to ensure only MaxBuffersInFlight number of frames are getting proccessed
|
||||
// by any stage in the Metal pipeline (App, Metal, Drivers, GPU, etc)
|
||||
dispatch_semaphore_wait(m_semaphore, DISPATCH_TIME_FOREVER);
|
||||
|
||||
if (!m_draw_parameters->buffer) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Wait to ensure only MaxBuffersInFlight number of frames are getting proccessed
|
||||
// by any stage in the Metal pipeline (App, Metal, Drivers, GPU, etc)
|
||||
dispatch_semaphore_wait(m_semaphore, DISPATCH_TIME_FOREVER);
|
||||
|
||||
// Iterate through our Metal buffers, and cycle back to the first when we've written to MaxBuffersInFlight
|
||||
m_current_buffer = (m_current_buffer + 1) % MaxBuffersInFlight;
|
||||
|
||||
|
|
Loading…
Reference in a new issue