Skip to content

Commit

Permalink
vulkan: allow out of date presentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kvark committed Feb 6, 2024
1 parent 62eb18d commit f35bc60
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions blade-graphics/src/vulkan/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,9 @@ impl super::CommandEncoder {
}
}

pub(super) fn check_gpu_crash<T>(&self, ret: Result<T, vk::Result>) -> T {
pub(super) fn check_gpu_crash<T>(&self, ret: Result<T, vk::Result>) -> Option<T> {
match ret {
Ok(value) => value,
Ok(value) => Some(value),
Err(vk::Result::ERROR_DEVICE_LOST) => match self.crash_handler {
Some(ref ch) => {
let last_id = unsafe { *(ch.marker_buf.data() as *mut u32) };
Expand All @@ -435,6 +435,10 @@ impl super::CommandEncoder {
panic!("GPU has crashed, and no debug information is available.");
}
},
Err(vk::Result::ERROR_OUT_OF_DATE_KHR) => {
log::warn!("GPU frame is out of date");
None
}
Err(other) => panic!("GPU error {}", other),
}
}
Expand Down

0 comments on commit f35bc60

Please sign in to comment.