Return VkResult from get_physical_device_surface_support

Fixes #185
This commit is contained in:
Mac O'Brien 2019-05-18 15:56:26 -05:00
parent 77fff855d3
commit 90d7218bda
2 changed files with 8 additions and 4 deletions

View file

@ -34,15 +34,19 @@ impl Surface {
physical_device: vk::PhysicalDevice,
queue_index: u32,
surface: vk::SurfaceKHR,
) -> bool {
) -> VkResult<bool> {
let mut b = mem::uninitialized();
self.surface_fn.get_physical_device_surface_support_khr(
let err_code = self.surface_fn.get_physical_device_surface_support_khr(
physical_device,
queue_index,
surface,
&mut b,
);
b > 0
match err_code {
vk::Result::SUCCESS => Ok(b > 0),
_ => Err(err_code)
}
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkGetPhysicalDeviceSurfacePresentModesKHR.html>"]

View file

@ -382,7 +382,7 @@ impl ExampleBase {
*pdevice,
index as u32,
surface,
);
).unwrap();
match supports_graphic_and_surface {
true => Some((*pdevice, index)),
_ => None,