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,
|
||||
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>"]
|
||||
|
|
|
@ -378,11 +378,13 @@ impl ExampleBase {
|
|||
.filter_map(|(index, ref info)| {
|
||||
let supports_graphic_and_surface =
|
||||
info.queue_flags.contains(vk::QueueFlags::GRAPHICS)
|
||||
&& surface_loader.get_physical_device_surface_support(
|
||||
*pdevice,
|
||||
index as u32,
|
||||
surface,
|
||||
);
|
||||
&& surface_loader
|
||||
.get_physical_device_surface_support(
|
||||
*pdevice,
|
||||
index as u32,
|
||||
surface,
|
||||
)
|
||||
.unwrap();
|
||||
match supports_graphic_and_surface {
|
||||
true => Some((*pdevice, index)),
|
||||
_ => None,
|
||||
|
|
Loading…
Reference in a new issue