use std::os::raw::{c_char, c_void};
use std::ptr::null;
use std::ptr::null_mut;
-#[cfg(unix)]
+#[cfg(target_os = "linux")]
use std::ptr::NonNull;
use std::slice;
use std::str::FromStr;
use swapchain::SurfacePlatform;
use sys_info;
use uuid;
-#[cfg(unix)]
+#[cfg(target_os = "linux")]
use xcb;
/// structure types the driver should know about
fn is_supported_structure_type(v: api::VkStructureType) -> bool {
- #[cfg(unix)]
+ #[cfg(target_os = "linux")]
{
#[cfg_attr(feature = "cargo-clippy", allow(clippy::single_match))]
match v {
VK_KHR_shader_draw_parameters,
VK_KHR_variable_pointers,
VK_KHR_swapchain,
- #[cfg(unix)]
+ #[cfg(target_os = "linux")]
VK_KHR_xcb_surface,
}
extensions![Extension::VK_KHR_external_semaphore_capabilities]
}
Extension::VK_KHR_swapchain => extensions![Extension::VK_KHR_surface],
- #[cfg(unix)]
+ #[cfg(target_os = "linux")]
Extension::VK_KHR_xcb_surface => extensions![Extension::VK_KHR_surface],
}
}
VK_KHR_shader_draw_parameters,
VK_KHR_variable_pointers,
VK_KHR_swapchain,
- #[cfg(unix)]
+ #[cfg(target_os = "linux")]
VK_KHR_xcb_surface,
)
}
}
Extension::VK_KHR_variable_pointers => api::VK_KHR_VARIABLE_POINTERS_SPEC_VERSION,
Extension::VK_KHR_swapchain => api::VK_KHR_SWAPCHAIN_SPEC_VERSION,
- #[cfg(unix)]
+ #[cfg(target_os = "linux")]
Extension::VK_KHR_xcb_surface => api::VK_KHR_XCB_SURFACE_SPEC_VERSION,
}
}
| Extension::VK_KHR_shader_draw_parameters
| Extension::VK_KHR_variable_pointers
| Extension::VK_KHR_swapchain => ExtensionScope::Device,
- #[cfg(unix)]
+ #[cfg(target_os = "linux")]
Extension::VK_KHR_xcb_surface => ExtensionScope::Instance,
}
}
proc_address!(vkGetPhysicalDevicePresentRectanglesKHR, PFN_vkGetPhysicalDevicePresentRectanglesKHR, device, extensions[Extension::VK_KHR_swapchain]);
proc_address!(vkAcquireNextImage2KHR, PFN_vkAcquireNextImage2KHR, device, extensions[Extension::VK_KHR_swapchain]);
- #[cfg(unix)]
+ #[cfg(target_os = "linux")]
proc_address!(vkCreateXcbSurfaceKHR, PFN_vkCreateXcbSurfaceKHR, device, extensions[Extension::VK_KHR_xcb_surface]);
- #[cfg(unix)]
+ #[cfg(target_os = "linux")]
proc_address!(vkGetPhysicalDeviceXcbPresentationSupportKHR, PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR, device, extensions[Extension::VK_KHR_xcb_surface]);
/*
proc_address!(vkCmdBeginConditionalRenderingEXT, PFN_vkCmdBeginConditionalRenderingEXT, device, unknown);
unimplemented!()
}
-#[cfg(unix)]
+#[cfg(target_os = "linux")]
#[allow(non_snake_case)]
pub unsafe extern "system" fn vkCreateXcbSurfaceKHR(
_instance: api::VkInstance,
api::VK_SUCCESS
}
-#[cfg(unix)]
+#[cfg(target_os = "linux")]
#[allow(non_snake_case)]
pub unsafe extern "system" fn vkGetPhysicalDeviceXcbPresentationSupportKHR(
_physicalDevice: api::VkPhysicalDevice,
use std::error::Error;
use std::fmt::{self, Debug};
use std::ptr::NonNull;
-#[cfg(unix)]
+#[cfg(target_os = "linux")]
use xcb_swapchain::XcbSurfaceImplementation;
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug, Enum)]
}
}
pub fn get_surface_implementation(self) -> Cow<'static, dyn SurfaceImplementation> {
- #[cfg(unix)]
+ #[cfg(target_os = "linux")]
const XCB_SURFACE_IMPLEMENTATION: XcbSurfaceImplementation = XcbSurfaceImplementation;
match self {
- #[cfg(unix)]
+ #[cfg(target_os = "linux")]
SurfacePlatform::VK_ICD_WSI_PLATFORM_XCB => Cow::Borrowed(&XCB_SURFACE_IMPLEMENTATION),
_ => Cow::Owned(FallbackSurfaceImplementation(self).duplicate()),
}