diff options
Diffstat (limited to 'patches')
-rw-r--r-- | patches/Android.bp.patch | 16 | ||||
-rw-r--r-- | patches/build.rs.patch | 13 | ||||
-rw-r--r-- | patches/device_memory.rs.patch | 40 | ||||
-rw-r--r-- | patches/instance.rs.patch | 38 | ||||
-rw-r--r-- | patches/properties.rs.patch | 13 |
5 files changed, 120 insertions, 0 deletions
diff --git a/patches/Android.bp.patch b/patches/Android.bp.patch new file mode 100644 index 0000000..97e8d62 --- /dev/null +++ b/patches/Android.bp.patch @@ -0,0 +1,16 @@ +diff --git a/Android.bp b/Android.bp +index 8e11707..a156cb8 100644 +--- a/Android.bp ++++ b/Android.bp +@@ -62,8 +62,10 @@ rust_defaults { + rust_test_host { + name: "vulkano_host_test_src_lib", + defaults: ["vulkano_test_defaults"], ++ // Manually disabled as these tests depend on specific graphics libraries ++ // being available on the machine running the tests. + test_options: { +- unit_test: true, ++ unit_test: false, + }, + } + diff --git a/patches/build.rs.patch b/patches/build.rs.patch new file mode 100644 index 0000000..4af564f --- /dev/null +++ b/patches/build.rs.patch @@ -0,0 +1,13 @@ +diff --git a/build.rs b/build.rs +index 1f2b2bf5..4da24a10 100644 +--- a/build.rs ++++ b/build.rs +@@ -7,6 +7,8 @@ + // notice may not be copied, modified, or distributed except + // according to those terms. + ++#![feature(str_split_once)] ++ + use std::{env, fs::File, io::BufWriter, path::Path}; + + mod autogen; diff --git a/patches/device_memory.rs.patch b/patches/device_memory.rs.patch new file mode 100644 index 0000000..becf2c2 --- /dev/null +++ b/patches/device_memory.rs.patch @@ -0,0 +1,40 @@ +diff --git a/src/memory/device_memory.rs b/src/memory/device_memory.rs +index 7f6bc8ff..be1eed9f 100644 +--- a/src/memory/device_memory.rs ++++ b/src/memory/device_memory.rs +@@ -19,7 +19,7 @@ use crate::OomError; + use crate::VulkanObject; + use std::error; + use std::fmt; +-#[cfg(target_os = "linux")] ++#[cfg(any(target_os = "android", target_os = "linux"))] + use std::fs::File; + use std::marker::PhantomData; + use std::mem::MaybeUninit; +@@ -27,7 +27,7 @@ use std::ops::Deref; + use std::ops::DerefMut; + use std::ops::Range; + use std::os::raw::c_void; +-#[cfg(target_os = "linux")] ++#[cfg(any(target_os = "android", target_os = "linux"))] + use std::os::unix::io::{FromRawFd, IntoRawFd}; + use std::ptr; + use std::sync::Arc; +@@ -178,7 +178,7 @@ impl<'a> DeviceMemoryBuilder<'a> { + /// # Panic + /// + /// - Panics if the import info has already been set. +- #[cfg(target_os = "linux")] ++ #[cfg(any(target_os = "android", target_os = "linux"))] + pub fn import_info( + mut self, + fd: File, +@@ -572,7 +572,7 @@ impl DeviceMemory { + /// + /// - Panics if the user requests an invalid handle type for this device memory object. + #[inline] +- #[cfg(target_os = "linux")] ++ #[cfg(any(target_os = "android", target_os = "linux"))] + pub fn export_fd( + &self, + handle_type: ExternalMemoryHandleType, diff --git a/patches/instance.rs.patch b/patches/instance.rs.patch new file mode 100644 index 0000000..e3409fd --- /dev/null +++ b/patches/instance.rs.patch @@ -0,0 +1,38 @@ +diff --git a/src/instance/instance.rs b/src/instance/instance.rs +index b887f1e2..d9f02276 100644 +--- a/src/instance/instance.rs ++++ b/src/instance/instance.rs +@@ -541,12 +541,12 @@ impl<'a> ApplicationInfo<'a> { + #[deprecated(note = "Please use the `app_info_from_cargo_toml!` macro instead")] + pub fn from_cargo_toml() -> ApplicationInfo<'a> { + let version = Version { +- major: env!("CARGO_PKG_VERSION_MAJOR").parse().unwrap(), +- minor: env!("CARGO_PKG_VERSION_MINOR").parse().unwrap(), +- patch: env!("CARGO_PKG_VERSION_PATCH").parse().unwrap(), ++ major: 0, ++ minor: 0, ++ patch: 0, + }; + +- let name = env!("CARGO_PKG_NAME"); ++ let name = ""; + + ApplicationInfo { + application_name: Some(name.into()), +@@ -568,12 +568,12 @@ impl<'a> ApplicationInfo<'a> { + macro_rules! app_info_from_cargo_toml { + () => {{ + let version = $crate::instance::Version { +- major: env!("CARGO_PKG_VERSION_MAJOR").parse().unwrap(), +- minor: env!("CARGO_PKG_VERSION_MINOR").parse().unwrap(), +- patch: env!("CARGO_PKG_VERSION_PATCH").parse().unwrap(), ++ major: 0, ++ minor: 0, ++ patch: 0, + }; + +- let name = env!("CARGO_PKG_NAME"); ++ let name = ""; + + $crate::instance::ApplicationInfo { + application_name: Some(name.into()), diff --git a/patches/properties.rs.patch b/patches/properties.rs.patch new file mode 100644 index 0000000..69d5b09 --- /dev/null +++ b/patches/properties.rs.patch @@ -0,0 +1,13 @@ +diff --git a/src/device/properties.rs b/src/device/properties.rs +index be1c36d..8628cb0 100644 +--- a/src/device/properties.rs ++++ b/src/device/properties.rs +@@ -212,7 +212,7 @@ impl<const N: usize> FromVulkan<[f32; N]> for [f32; N] { + + impl<const N: usize> FromVulkan<[std::os::raw::c_char; N]> for String { + #[inline] +- fn from_vulkan(val: [i8; N]) -> Option<Self> { ++ fn from_vulkan(val: [std::os::raw::c_char; N]) -> Option<Self> { + Some(unsafe { CStr::from_ptr(val.as_ptr()).to_string_lossy().into_owned() }) + } + } |