Wait on the semaphore and signal when the buffer is done

This commit is contained in:
Eryn Wells 2018-10-13 20:53:23 -07:00
parent dd0306f67a
commit f4a9f56fa7

View file

@ -199,6 +199,11 @@ public class Renderer: NSObject, MTKViewDelegate {
var didEncode = false
// Make sure we attempt to enqueue more than one buffer at a time.
inFlightSemaphore.wait()
buffer.addCompletedHandler { _ in
self.inFlightSemaphore.signal()
}
buffer.label = "Metaballs Command Buffer"