diff --git a/include/dawn/native/VulkanBackend.h b/include/dawn/native/VulkanBackend.h index 201bc3242f..3221ad2e37 100644 --- a/include/dawn/native/VulkanBackend.h +++ b/include/dawn/native/VulkanBackend.h @@ -83,7 +83,7 @@ struct ExternalImageExportInfoVk : ExternalImageExportInfo { }; // Can't use DAWN_PLATFORM_IS(LINUX) since header included in both Dawn and Chrome -#if defined(__linux__) || defined(__Fuchsia__) +#if defined(__linux__) || defined(__Fuchsia__) || defined(__OpenBSD__) || defined(__FreeBSD__) // Common properties of external images represented by FDs. On successful import the file // descriptor's ownership is transferred to the Dawn implementation and they shouldn't be diff --git a/src/dawn/common/Platform.h b/src/dawn/common/Platform.h index b4ac61004d..cbc5c7b8b5 100644 --- a/src/dawn/common/Platform.h +++ b/src/dawn/common/Platform.h @@ -60,6 +60,11 @@ #error "Unsupported Windows platform." #endif +#elif defined(__OpenBSD__) || defined(__FreeBSD__) +#define DAWN_PLATFORM_IS_LINUX 1 +#define DAWN_PLATFORM_IS_BSD 1 +#define DAWN_PLATFORM_IS_POSIX 1 + #elif defined(__linux__) #define DAWN_PLATFORM_IS_LINUX 1 #define DAWN_PLATFORM_IS_POSIX 1 diff --git a/src/dawn/native/vulkan/BackendVk.cpp b/src/dawn/native/vulkan/BackendVk.cpp index 783a15ab55..29405d2003 100644 --- a/src/dawn/native/vulkan/BackendVk.cpp +++ b/src/dawn/native/vulkan/BackendVk.cpp @@ -57,7 +57,7 @@ constexpr char kSwiftshaderLibName[] = "libvk_swiftshader.dylib"; #endif #if DAWN_PLATFORM_IS(LINUX) -#if DAWN_PLATFORM_IS(ANDROID) +#if DAWN_PLATFORM_IS(ANDROID) || DAWN_PLATFORM_IS(BSD) constexpr char kVulkanLibName[] = "libvulkan.so"; #else constexpr char kVulkanLibName[] = "libvulkan.so.1";