From ace560673a6da1ed4740acfdd14817d06846ef4a Mon Sep 17 00:00:00 2001 From: 180watt <160363743+180watt@users.noreply.github.com> Date: Sun, 4 Aug 2024 01:44:05 -0400 Subject: [PATCH] Add support for FreeBSD (#152) Just a few cfg changes to allow Vulkan rendering on FreeBSD. Tested both GLES and Vulkan to be working on FreeBSD-current with drm-5.15. --- blade-graphics/Cargo.toml | 2 +- blade-graphics/src/lib.rs | 24 +++++++++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/blade-graphics/Cargo.toml b/blade-graphics/Cargo.toml index 70ad7485..1144c9ce 100644 --- a/blade-graphics/Cargo.toml +++ b/blade-graphics/Cargo.toml @@ -26,7 +26,7 @@ metal = "0.29" objc = "0.2.5" naga = { workspace = true, features = ["msl-out"] } -[target.'cfg(any(vulkan, windows, target_os = "linux", target_os = "android"))'.dependencies] +[target.'cfg(any(vulkan, windows, target_os = "linux", target_os = "android", target_os = "freebsd"))'.dependencies] ash = "0.38" ash-window = "0.13" gpu-alloc = "0.6" diff --git a/blade-graphics/src/lib.rs b/blade-graphics/src/lib.rs index dc7b3720..3976a7e1 100644 --- a/blade-graphics/src/lib.rs +++ b/blade-graphics/src/lib.rs @@ -55,7 +55,13 @@ pub mod derive; #[cfg_attr( all( not(gles), - any(vulkan, windows, target_os = "linux", target_os = "android") + any( + vulkan, + windows, + target_os = "linux", + target_os = "android", + target_os = "freebsd" + ) ), path = "vulkan/mod.rs" )] @@ -90,12 +96,24 @@ pub struct ContextDesc { pub enum NotSupportedError { #[cfg(all( not(gles), - any(vulkan, windows, target_os = "linux", target_os = "android") + any( + vulkan, + windows, + target_os = "linux", + target_os = "android", + target_os = "freebsd" + ) ))] VulkanLoadingError(ash::LoadingError), #[cfg(all( not(gles), - any(vulkan, windows, target_os = "linux", target_os = "android") + any( + vulkan, + windows, + target_os = "linux", + target_os = "android", + target_os = "freebsd" + ) ))] VulkanError(ash::vk::Result),