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

iOS screen rotation broken in 0.15 #16604

Open
extrawurst opened this issue Dec 2, 2024 · 8 comments
Open

iOS screen rotation broken in 0.15 #16604

extrawurst opened this issue Dec 2, 2024 · 8 comments
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior O-iOS Specific to the iOS mobile operating system S-Needs-Investigation This issue requires detective work to figure out what's going wrong

Comments

@extrawurst
Copy link
Contributor

Bevy version

bevy 0.15

[Optional] Relevant system information

MacOs 15.1.1 (24B91)
XCode 16.1 (16B40)

Tested in Simulator

AdapterInfo { name: "Apple iOS simulator GPU", vendor: 0, device: 0, device_type: DiscreteGpu, driver: "", driver_info: "", backend: Metal }

What you did

Just running bevy_mobile_example in the iOS Simulator

What went wrong

If you rotate the device, bevy should adapt its viewport from portrait to landscape but it is stuck in portrait:

Image

@extrawurst extrawurst added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Dec 2, 2024
@alice-i-cecile alice-i-cecile added A-Windowing Platform-agnostic interface layer to run your app in O-iOS Specific to the iOS mobile operating system S-Needs-Investigation This issue requires detective work to figure out what's going wrong and removed S-Needs-Triage This issue needs to be labelled labels Dec 2, 2024
@seivan
Copy link

seivan commented Dec 4, 2024

@extrawurst Have you tested raw WGPU + Winit?
What Winit / Window settings did you have?

@extrawurst
Copy link
Contributor Author

extrawurst commented Dec 4, 2024

@extrawurst Have you tested raw WGPU + Winit?

No

What Winit / Window settings did you have?

The one the bevy_mobile_example inside the bevy repo uses

@Braymatter
Copy link
Contributor

Braymatter commented Jan 14, 2025

Adding on to this - Winit/bevy_winit is emitting window resized events, with appropriate dimensions:

Image

What is interesting is that touch events don't register when tapping the black / unrendered portion of the screen:

Image

On my app animations are still running so I think we're still requesting redraws from winit - since there wasn't a new version of Winit from version 0.14 to 0.15, I think the issue is definitely in the bevy code.

I'm unsure what actually determines the render area for the camera etc. but as Winit is not sending touch gestures back up to bevy in the black area - it seems as though the actual winit-window isn't actually resizing (unless we're doing bounds checking on touch/pointer inputs somewhere I didn't see)

@HackerFoo
Copy link
Contributor

HackerFoo commented Jan 25, 2025

I spent some time on this. The render target has the right dimensions after changing window size, and Bevy can only request a window size change, but the iOS backend ignores this anyway.

Furthermore, the sizes in winits WinitView::draw_rect and WinitView::layout_subviews all seem correct, and the file hasn't been touched for about 2 years. I think it's also unlikely that Apple changed the API.

Nonetheless, this can be tested easily by running an iOS app as "Design for iPad" and resizing the window. No matter how the window is resized, the rendered rectangle stays the same size, surrounded by gray.

@HackerFoo
Copy link
Contributor

I ran git bisect using the mobile example and it led to this commit upgrading to wgpu 23.

@HackerFoo
Copy link
Contributor

HackerFoo commented Jan 25, 2025

Downgrading wgpu fixed my app. So now I need to bisect wgpu.

@HackerFoo
Copy link
Contributor

HackerFoo commented Jan 26, 2025

Starting with wgpu-v23.0.1, reverting gfx-rs/wgpu#6535 then gfx-rs/wgpu#6535 then gfx-rs/wgpu#6107 fixed the problem: https://github.com/HackerFoo/wgpu/commits/fix/

@BenjaminBrienen
Copy link
Contributor

Can you create an issue in wgpu to address this regression?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior O-iOS Specific to the iOS mobile operating system S-Needs-Investigation This issue requires detective work to figure out what's going wrong
Projects
None yet
Development

No branches or pull requests

6 participants