mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2025-02-19 18:42:31 +00:00
Move swapchain acquire timeout to user code
This commit is contained in:
parent
b5c2d3d5f8
commit
3735fd0062
@ -229,7 +229,7 @@ fn main() {
|
||||
loop {
|
||||
// Before we can draw on the output, we have to *acquire* an image from the swapchain.
|
||||
// This operation returns the index of the image that we are allowed to draw upon..
|
||||
let image_num = swapchain.acquire_next_image().unwrap();
|
||||
let image_num = swapchain.acquire_next_image(1000000).unwrap();
|
||||
|
||||
// Our queue is wrapped around a `Mutex`, so we have to lock it.
|
||||
let mut queue = queue.lock().unwrap();
|
||||
|
@ -154,7 +154,7 @@ impl Swapchain {
|
||||
///
|
||||
/// If you try to draw on an image without acquiring it first, the execution will block. (TODO
|
||||
/// behavior may change).
|
||||
pub fn acquire_next_image(&self) -> Result<usize, AcquireError> {
|
||||
pub fn acquire_next_image(&self, timeout_ns: u64) -> Result<usize, AcquireError> {
|
||||
let vk = self.device.pointers();
|
||||
|
||||
unsafe {
|
||||
@ -162,7 +162,7 @@ impl Swapchain {
|
||||
|
||||
let mut out = mem::uninitialized();
|
||||
let r = try!(check_errors(vk.AcquireNextImageKHR(self.device.internal_object(),
|
||||
self.swapchain, 1000000,
|
||||
self.swapchain, timeout_ns,
|
||||
semaphore.internal_object(), 0, // TODO: timeout
|
||||
&mut out)));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user