Skip to content

Commit

Permalink
wgpu-hal: add ndk-sys dependency to fix linking error. (gfx-rs#5326)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashdnazg authored and cwfitzgerald committed Mar 1, 2024
1 parent 3e32866 commit 7cf0a27
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ By @cwfitzgerald in [#5325](https://github.com/gfx-rs/wgpu/pull/5325).

- Fix an issue where command encoders weren't properly freed if an error occurred during command encoding. By @ErichDonGubler in [#5251](https://github.com/gfx-rs/wgpu/pull/5251).

#### Android
- Fix linking error when targeting android without `winit`. By @ashdnazg in [#5326](https://github.com/gfx-rs/wgpu/pull/5326).

## v0.19.2 (2024-02-29)

### Added/New Features
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions wgpu-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ libc = "0.2"

[target.'cfg(target_os = "android")'.dependencies]
android_system_properties = "0.1.1"
ndk-sys = "0.5.0"

[dependencies.naga]
path = "../naga"
Expand Down
17 changes: 6 additions & 11 deletions wgpu-hal/src/gles/egl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,6 @@ type WlEglWindowResizeFun = unsafe extern "system" fn(

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;

#[allow(clippy::upper_case_acronyms)]
Expand Down Expand Up @@ -863,7 +853,12 @@ impl crate::Instance<super::Api> for Instance {
.unwrap();

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 {
Expand Down

0 comments on commit 7cf0a27

Please sign in to comment.