wgpu-hal: add ndk-sys dependency to fix linking error. (#5326)

This commit is contained in:
Eshed Schacham 2024-03-01 23:16:09 +02:00 committed by GitHub
parent aaf6db6a3d
commit 2d8d045453
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 11 deletions

View File

@ -136,6 +136,7 @@ By @cwfitzgerald in [#5325](https://github.com/gfx-rs/wgpu/pull/5325).
- Fix registry leaks with de-duplicated resources. By @nical in [#5244](https://github.com/gfx-rs/wgpu/pull/5244) - Fix registry leaks with de-duplicated resources. By @nical in [#5244](https://github.com/gfx-rs/wgpu/pull/5244)
- Fix behavior of integer `clamp` when `min` argument > `max` argument. By @cwfitzgerald in [#5300](https://github.com/gfx-rs/wgpu/pull/5300). - Fix behavior of integer `clamp` when `min` argument > `max` argument. By @cwfitzgerald in [#5300](https://github.com/gfx-rs/wgpu/pull/5300).
- Fix missing validation for `Device::clear_buffer` where `offset + size buffer.size` was not checked when `size` was omitted. By @ErichDonGubler in [#5282](https://github.com/gfx-rs/wgpu/pull/5282). - Fix missing validation for `Device::clear_buffer` where `offset + size buffer.size` was not checked when `size` was omitted. By @ErichDonGubler in [#5282](https://github.com/gfx-rs/wgpu/pull/5282).
- Fix linking when targeting android. By @ashdnazg in [#5326](https://github.com/gfx-rs/wgpu/pull/5326).
#### glsl-in #### glsl-in

1
Cargo.lock generated
View File

@ -4074,6 +4074,7 @@ dependencies = [
"log", "log",
"metal", "metal",
"naga", "naga",
"ndk-sys 0.5.0+25.2.9519653",
"objc", "objc",
"once_cell", "once_cell",
"parking_lot", "parking_lot",

View File

@ -166,6 +166,7 @@ libc = "0.2"
[target.'cfg(target_os = "android")'.dependencies] [target.'cfg(target_os = "android")'.dependencies]
android_system_properties = "0.1.1" android_system_properties = "0.1.1"
ndk-sys = "0.5.0"
[dependencies.naga] [dependencies.naga]
path = "../naga" path = "../naga"

View File

@ -50,16 +50,6 @@ type WlEglWindowResizeFun = unsafe extern "system" fn(
type WlEglWindowDestroyFun = unsafe extern "system" fn(window: *const raw::c_void); type WlEglWindowDestroyFun = unsafe extern "system" fn(window: *const raw::c_void);
#[cfg(target_os = "android")]
extern "C" {
pub fn ANativeWindow_setBuffersGeometry(
window: *mut raw::c_void,
width: i32,
height: i32,
format: i32,
) -> i32;
}
type EglLabel = *const raw::c_void; type EglLabel = *const raw::c_void;
#[allow(clippy::upper_case_acronyms)] #[allow(clippy::upper_case_acronyms)]
@ -864,7 +854,12 @@ impl crate::Instance<super::Api> for Instance {
.unwrap(); .unwrap();
let ret = unsafe { let ret = unsafe {
ANativeWindow_setBuffersGeometry(handle.a_native_window.as_ptr(), 0, 0, format) ndk_sys::ANativeWindow_setBuffersGeometry(
handle.a_native_window.as_ptr() as *mut ndk_sys::ANativeWindow,
0,
0,
format,
)
}; };
if ret != 0 { if ret != 0 {