metal: Remove wait
This commit is contained in:
parent
059a271b3b
commit
5ba95f714d
1 changed files with 8 additions and 5 deletions
|
|
@ -478,16 +478,19 @@ pub const SwapChain = struct {
|
||||||
const pool = objc.autoreleasePoolPush();
|
const pool = objc.autoreleasePoolPush();
|
||||||
defer objc.autoreleasePoolPop(pool);
|
defer objc.autoreleasePoolPop(pool);
|
||||||
|
|
||||||
if (swapchain.current_drawable) |_| {
|
if (swapchain.current_drawable) |drawable| {
|
||||||
const queue = try swapchain.device.getQueue();
|
const queue = try swapchain.device.getQueue();
|
||||||
const command_buffer: *mtl.CommandBuffer = queue.command_queue.commandBuffer() orelse {
|
const command_buffer: *mtl.CommandBuffer = queue.command_queue.commandBuffer() orelse {
|
||||||
return error.NewCommandBufferFailed;
|
return error.NewCommandBufferFailed;
|
||||||
};
|
};
|
||||||
|
|
||||||
command_buffer.presentDrawable(@ptrCast(swapchain.current_drawable)); // TODO - objc casting?
|
if (swapchain.surface.layer.displaySyncEnabled()) {
|
||||||
command_buffer.commit();
|
command_buffer.commit();
|
||||||
if (swapchain.surface.layer.displaySyncEnabled())
|
drawable.present();
|
||||||
command_buffer.waitUntilCompleted();
|
} else {
|
||||||
|
command_buffer.presentDrawable(@ptrCast(drawable));
|
||||||
|
command_buffer.commit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue