Skip to content

Commit

Permalink
Add support for FreeBSD
Browse files Browse the repository at this point in the history
Just a few cfg changes to allow vulkan rendering on FreeBSD.
  • Loading branch information
180watt authored and seafork committed Aug 4, 2024
1 parent 407a04b commit 2c89bec
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion blade-graphics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
24 changes: 21 additions & 3 deletions blade-graphics/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)]
Expand Down Expand Up @@ -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),

Expand Down

0 comments on commit 2c89bec

Please sign in to comment.