Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

ashdnazg
Copy link
Contributor

@ashdnazg ashdnazg commented Mar 1, 2024

Description
Compilation of an android library which depends on wgpu fails during linking with the error:

ld: error: undefined symbol: ANativeWindow_setBuffersGeometry

This isn't encountered in the tests, since the dev dependencies include winit which depends on ndk-sys when targeting android.

Testing
This was tested by succeeding to compile a project which did not compile previously.

Checklist

  • Run cargo fmt.
  • Run cargo clippy.
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

This issue is invisible in the tests, since the dev dependencies include
winit which itself depends on ndk-sys when using android.
@ashdnazg ashdnazg requested a review from a team as a code owner March 1, 2024 13:00
Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice

@cwfitzgerald cwfitzgerald enabled auto-merge (squash) March 1, 2024 20:55
@cwfitzgerald cwfitzgerald merged commit 2d8d045 into gfx-rs:trunk Mar 1, 2024
27 checks passed
@cwfitzgerald cwfitzgerald added the PR: needs back-porting PR with a fix that needs to land on crates label Mar 1, 2024
cwfitzgerald pushed a commit to cwfitzgerald/wgpu that referenced this pull request Mar 1, 2024
@cwfitzgerald cwfitzgerald mentioned this pull request Mar 1, 2024
cwfitzgerald pushed a commit to cwfitzgerald/wgpu that referenced this pull request Mar 1, 2024
cwfitzgerald pushed a commit to cwfitzgerald/wgpu that referenced this pull request Mar 1, 2024
@cwfitzgerald cwfitzgerald removed the PR: needs back-porting PR with a fix that needs to land on crates label Mar 1, 2024
@MarijnS95
Copy link
Contributor

Seeing this from the changelog: any clue why this function is called in the first place? git blame doesn't help.

I've played with EGL on Android a fair bit and it always returns configs for all available formats, on devices I've tested. Only when calling ANativeWindow_setBuffersGeometry() is the output limited to just EGL configs containing that format set on the "Surface".

Is the assumption that the user may have limited the format before, so that this function is used to change it again, or to make config filtering easier?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants