Merge #211
211: Return VkResult from get_physical_device_surface_support r=MaikKlein a=cormac-obrien Fixes #185 Co-authored-by: Mac O'Brien <cormac@c-obrien.org>
This commit is contained in:
commit
be5e233545
|
@ -34,15 +34,19 @@ impl Surface {
|
||||||
physical_device: vk::PhysicalDevice,
|
physical_device: vk::PhysicalDevice,
|
||||||
queue_index: u32,
|
queue_index: u32,
|
||||||
surface: vk::SurfaceKHR,
|
surface: vk::SurfaceKHR,
|
||||||
) -> bool {
|
) -> VkResult<bool> {
|
||||||
let mut b = mem::uninitialized();
|
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,
|
physical_device,
|
||||||
queue_index,
|
queue_index,
|
||||||
surface,
|
surface,
|
||||||
&mut b,
|
&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>"]
|
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkGetPhysicalDeviceSurfacePresentModesKHR.html>"]
|
||||||
|
|
|
@ -378,11 +378,13 @@ impl ExampleBase {
|
||||||
.filter_map(|(index, ref info)| {
|
.filter_map(|(index, ref info)| {
|
||||||
let supports_graphic_and_surface =
|
let supports_graphic_and_surface =
|
||||||
info.queue_flags.contains(vk::QueueFlags::GRAPHICS)
|
info.queue_flags.contains(vk::QueueFlags::GRAPHICS)
|
||||||
&& surface_loader.get_physical_device_surface_support(
|
&& surface_loader
|
||||||
|
.get_physical_device_surface_support(
|
||||||
*pdevice,
|
*pdevice,
|
||||||
index as u32,
|
index as u32,
|
||||||
surface,
|
surface,
|
||||||
);
|
)
|
||||||
|
.unwrap();
|
||||||
match supports_graphic_and_surface {
|
match supports_graphic_and_surface {
|
||||||
true => Some((*pdevice, index)),
|
true => Some((*pdevice, index)),
|
||||||
_ => None,
|
_ => None,
|
||||||
|
|
Loading…
Reference in a new issue