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

[Merged by Bors] - Update wgpu to 0.14.0, naga to 0.10.0, winit to 0.27.4, raw-window-handle to 0.5.0, ndk to 0.7 #6218

Closed
wants to merge 12 commits into from

Conversation

VitalyAnkh
Copy link
Contributor

@VitalyAnkh VitalyAnkh commented Oct 10, 2022

Objective

  • Update wgpu to 0.14.0, naga to 0.10.0, winit to 0.27.4, raw-window-handle to 0.5.0, ndk to 0.7.

Solution


Changelog

Changed

  • Changed RawWindowHandleWrapper to RawHandleWrapper which wraps both RawWindowHandle and RawDisplayHandle, which satisfies the impl HasRawWindowHandle and HasRawDisplayHandle that wgpu 0.14.0 requires.

  • Changed bevy_window::WindowDescriptor's cursor_locked to cursor_grab_mode, change its type from bool to bevy_window::CursorGrabMode.

Migration Guide

  • Adjust usage of bevy_window::WindowDescriptor's cursor_locked to cursor_grab_mode, and adjust its type from bool to bevy_window::CursorGrabMode.

@VitalyAnkh VitalyAnkh force-pushed the new_winit branch 3 times, most recently from 716b294 to 8e661f0 Compare October 10, 2022 09:15
@mockersf
Copy link
Member

related to #5347 and #6086

@VitalyAnkh VitalyAnkh force-pushed the new_winit branch 4 times, most recently from 07744da to e8f72ea Compare October 10, 2022 14:02
@alice-i-cecile alice-i-cecile added the C-Dependencies A change to the crates that Bevy depends on label Oct 10, 2022
@VitalyAnkh VitalyAnkh changed the title Update wgpu to 0.14.0, winit to 0.27.4, raw-window-handle to 0.5.0 Update wgpu to 0.14.0, naga to 0.10.0, winit to 0.27.4, raw-window-handle to 0.5.0 Oct 12, 2022
@VitalyAnkh VitalyAnkh changed the title Update wgpu to 0.14.0, naga to 0.10.0, winit to 0.27.4, raw-window-handle to 0.5.0 Update wgpu to 0.14.0, naga to 0.10.0, winit to 0.27.4, raw-window-handle to 0.5.0, ndk to 0.7 Oct 12, 2022
@@ -727,3 +727,12 @@ fn handle_create_window_events(
}
}
}

/// Map `bevy_window::CursorGrabMode` to `winit::window::CursorGrabMode`.
fn winit_grab_mode(mode: bevy_window::CursorGrabMode) -> winit::window::CursorGrabMode {
Copy link
Member

Choose a reason for hiding this comment

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

IMO this should be a From impl.

Copy link
Member

Choose a reason for hiding this comment

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

Or I guess an Into impl if orphan rules get in the way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found it's not comfortable to do this for bevy_window::CursorGrabMode and winit::window:CursorGrabMode are not defined in the bevy_winit crate so orphan rules deny any From and Into impl. How about just using a match expression, removing this function?

Copy link
Member

Choose a reason for hiding this comment

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

Sure I'm fine with that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using a simple match causes code duplication so I suggest leaving code as it is 😄

Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

A couple tiny issues, but I'd like to get moving on this one. Reviewers: please test this one out; there's lots of potential for new serious hardware / OS / driver issues.

deny.toml Outdated Show resolved Hide resolved
Copy link
Contributor

@torsteingrindvik torsteingrindvik left a comment

Choose a reason for hiding this comment

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

Tried some examples locally:

  • wireframe
  • vertex_colors
  • two_passes
  • text
  • ui
  • sprite_sheet
  • transparency_3d
  • many_foxes

They all seem fine to me.

@VitalyAnkh
Copy link
Contributor Author

I feel this PR is in good shape now. Ping @alice-i-cecile @mockersf.

@rparrett
Copy link
Contributor

rparrett commented Oct 18, 2022

Tested all examples in the window and shader directories. (MacOS)

@alice-i-cecile alice-i-cecile added this to the Bevy 0.9 milestone Oct 18, 2022
@alice-i-cecile alice-i-cecile added A-Input Player input via keyboard, mouse, gamepad, and more A-Windowing Platform-agnostic interface layer to run your app in labels Oct 19, 2022
This was referenced Oct 19, 2022
@rparrett
Copy link
Contributor

rparrett commented Oct 19, 2022

I don't know what the normal state of affairs is for iOS, but in the simulator I have working touch camera controls and sound, but the "Test Button" does not work.

The console gets spammed with

2022-10-19T14:20:12.189477Z WARN winit::platform_impl::platform::app_state: processing non RedrawRequested event after the main event loop: RedrawEventsCleared

2022-10-19T14:20:12.198663Z WARN bevy_render::camera::camera_driver_node: Camera priority ambiguities detected for active cameras with the following priorities: {(0, Window(WindowId(00000000-0000-0000-0000-000000000000)))}. To fix this, ensure there is exactly one Camera entity spawned with a given priority for a given RenderTarget. Ambiguities should be resolved because either (1) multiple active cameras were spawned accidentally, which will result in rendering multiple instances of the scene or (2) for cases where multiple active cameras is intentional, ambiguities could result in unpredictable render results.

@rparrett
Copy link
Contributor

rparrett commented Oct 19, 2022

The ios example is spawning 2 cameras for some reason. With that fixed, we're still left with the RedrawRequested spam and the broken button.

@rparrett
Copy link
Contributor

Looks like the button is broken pre-this-PR as well so I think we're good to go there.

Co-authored-by: Rob Parrett <robparrett@gmail.com>
@rparrett
Copy link
Contributor

rparrett commented Oct 19, 2022

I got the android example running on my device (pixel 2 xl) but only with NDK 25.1.8937393 and compiling without bevy_audio.

cargo apk run --example android_example --no-default-features --features "bevy_winit,render,bevy_asset"

I had to lower a WgpuLimit:

let mut settings = WgpuSettings {
    priority: WgpuSettingsPriority::Compatibility,
    ..default()
};
settings.limits.max_storage_textures_per_shader_stage = 4;

And resuming after putting the app in the background causes it to crash with this error:

10-19 12:52:26.837  8148  8181 E vulkan  : NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS query failed: No such device (-19) value=0
10-19 12:52:26.837  8148  8181 E log event:  get_physical_device_surface_present_modes: ERROR_SURFACE_LOST_KHRlog.target = "wgpu_hal::vulkan::adapter"; log.module_path = "wgpu_hal::vulkan::adapter"; log.file = "/Users/robparrett/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-hal-0.14.0/src/vulkan/adapter.rs"; log.line = 1512;
10-19 12:52:26.838  8148  8181 E vulkan  : dequeueBuffer failed: No such device (-19)

I had thought that we'd be able to do audio now that we have ndk-glue 0.7 across the board. But this was my first time actually succeeding in running on android and I haven't been following the progress there closely.

Regardless, I don't think there's a regression here, so we're probably good to go.

@VitalyAnkh
Copy link
Contributor Author

And resuming after putting the app in the background causes it to crash with this error

I think this deserves an issue report, and let's fix it in the future 🚀

@mockersf
Copy link
Member

I had thought that we'd be able to do audio now that we have ndk-glue 0.7 across the board. But this was my first time actually succeeding in running on android and I haven't been following the progress there closely.

No, rodio hasn't been updated to the latest latest ndk-glue... 😞

Regardless, I don't think there's a regression here, so we're probably good to go.

Yup, all things you mentioned are expected 👍

@mockersf
Copy link
Member

thanks @rparrett for testing on iOS and Android 🎉

@alice-i-cecile
Copy link
Member

Alright, I'm going to call this sufficiently tested and reviewed and merge it now.

bors r+

bors bot pushed a commit that referenced this pull request Oct 19, 2022
…window-handle` to 0.5.0, `ndk` to 0.7 (#6218)

# Objective

- Update `wgpu` to 0.14.0, `naga` to `0.10.0`, `winit` to 0.27.4, `raw-window-handle` to 0.5.0, `ndk` to 0.7.

## Solution

---

## Changelog

### Changed

- Changed `RawWindowHandleWrapper` to `RawHandleWrapper` which wraps both `RawWindowHandle` and `RawDisplayHandle`, which satisfies the `impl HasRawWindowHandle and HasRawDisplayHandle` that `wgpu` 0.14.0 requires.

- Changed `bevy_window::WindowDescriptor`'s `cursor_locked` to `cursor_grab_mode`, change its type from `bool` to `bevy_window::CursorGrabMode`.

## Migration Guide

- Adjust usage of `bevy_window::WindowDescriptor`'s `cursor_locked` to `cursor_grab_mode`, and adjust its type from `bool` to `bevy_window::CursorGrabMode`.
@bors
Copy link
Contributor

bors bot commented Oct 19, 2022

@bors bors bot changed the title Update wgpu to 0.14.0, naga to 0.10.0, winit to 0.27.4, raw-window-handle to 0.5.0, ndk to 0.7 [Merged by Bors] - Update wgpu to 0.14.0, naga to 0.10.0, winit to 0.27.4, raw-window-handle to 0.5.0, ndk to 0.7 Oct 19, 2022
@bors bors bot closed this Oct 19, 2022
@mockersf mockersf added the hacktoberfest-accepted A PR that was accepted for Hacktoberfest, an annual open source event label Oct 19, 2022
@ickk ickk added the C-Breaking-Change A breaking change to Bevy's public API that needs to be noted in a migration guide label Oct 25, 2022
james7132 pushed a commit to james7132/bevy that referenced this pull request Oct 28, 2022
…window-handle` to 0.5.0, `ndk` to 0.7 (bevyengine#6218)

# Objective

- Update `wgpu` to 0.14.0, `naga` to `0.10.0`, `winit` to 0.27.4, `raw-window-handle` to 0.5.0, `ndk` to 0.7.

## Solution

---

## Changelog

### Changed

- Changed `RawWindowHandleWrapper` to `RawHandleWrapper` which wraps both `RawWindowHandle` and `RawDisplayHandle`, which satisfies the `impl HasRawWindowHandle and HasRawDisplayHandle` that `wgpu` 0.14.0 requires.

- Changed `bevy_window::WindowDescriptor`'s `cursor_locked` to `cursor_grab_mode`, change its type from `bool` to `bevy_window::CursorGrabMode`.

## Migration Guide

- Adjust usage of `bevy_window::WindowDescriptor`'s `cursor_locked` to `cursor_grab_mode`, and adjust its type from `bool` to `bevy_window::CursorGrabMode`.
bors bot pushed a commit that referenced this pull request Oct 31, 2022
# Objective

- Bevy main crashs on Safari mobile
- On Safari mobile, calling winit_window.set_cursor_grab(true) fails as the API is not implemented (as there is no cursor on Safari mobile, the api doesn't make sense there). I don't know about other mobile browsers

## Solution

- Do not call the api to release cursor grab on window creation, as the cursor is not grabbed anyway at this point
- This is #3617 which was lost in #6218
Pietrek14 pushed a commit to Pietrek14/bevy that referenced this pull request Dec 17, 2022
…window-handle` to 0.5.0, `ndk` to 0.7 (bevyengine#6218)

# Objective

- Update `wgpu` to 0.14.0, `naga` to `0.10.0`, `winit` to 0.27.4, `raw-window-handle` to 0.5.0, `ndk` to 0.7.

## Solution

---

## Changelog

### Changed

- Changed `RawWindowHandleWrapper` to `RawHandleWrapper` which wraps both `RawWindowHandle` and `RawDisplayHandle`, which satisfies the `impl HasRawWindowHandle and HasRawDisplayHandle` that `wgpu` 0.14.0 requires.

- Changed `bevy_window::WindowDescriptor`'s `cursor_locked` to `cursor_grab_mode`, change its type from `bool` to `bevy_window::CursorGrabMode`.

## Migration Guide

- Adjust usage of `bevy_window::WindowDescriptor`'s `cursor_locked` to `cursor_grab_mode`, and adjust its type from `bool` to `bevy_window::CursorGrabMode`.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
…window-handle` to 0.5.0, `ndk` to 0.7 (bevyengine#6218)

# Objective

- Update `wgpu` to 0.14.0, `naga` to `0.10.0`, `winit` to 0.27.4, `raw-window-handle` to 0.5.0, `ndk` to 0.7.

## Solution

---

## Changelog

### Changed

- Changed `RawWindowHandleWrapper` to `RawHandleWrapper` which wraps both `RawWindowHandle` and `RawDisplayHandle`, which satisfies the `impl HasRawWindowHandle and HasRawDisplayHandle` that `wgpu` 0.14.0 requires.

- Changed `bevy_window::WindowDescriptor`'s `cursor_locked` to `cursor_grab_mode`, change its type from `bool` to `bevy_window::CursorGrabMode`.

## Migration Guide

- Adjust usage of `bevy_window::WindowDescriptor`'s `cursor_locked` to `cursor_grab_mode`, and adjust its type from `bool` to `bevy_window::CursorGrabMode`.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
…e#6381)

# Objective

- Bevy main crashs on Safari mobile
- On Safari mobile, calling winit_window.set_cursor_grab(true) fails as the API is not implemented (as there is no cursor on Safari mobile, the api doesn't make sense there). I don't know about other mobile browsers

## Solution

- Do not call the api to release cursor grab on window creation, as the cursor is not grabbed anyway at this point
- This is bevyengine#3617 which was lost in bevyengine#6218
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Input Player input via keyboard, mouse, gamepad, and more A-Rendering Drawing game state to the screen A-Windowing Platform-agnostic interface layer to run your app in C-Breaking-Change A breaking change to Bevy's public API that needs to be noted in a migration guide C-Dependencies A change to the crates that Bevy depends on hacktoberfest-accepted A PR that was accepted for Hacktoberfest, an annual open source event S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants