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 crashes on Redmi k60pro mobile phone due to too high of resolution #16361

Open
ysypnbh opened this issue Nov 12, 2024 · 2 comments
Open
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior O-Android Specific to the Android mobile operating system P-Crash A sudden unexpected crash S-Needs-Investigation This issue requires detective work to figure out what's going wrong

Comments

@ysypnbh
Copy link

ysypnbh commented Nov 12, 2024

https://bevyengine.org/examples/3d-rendering/3d-scene/

This is my actual machine demonstration. Please tell me how to solve it. I also want to write a demo that can be displayed on mobile phones.

wasm_example.js:1885 panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.20.1/src/backend/wgpu_core.rs:751:18:
Error in Surface::configure: Validation Error

Caused by:
    `Surface` width and height must be within the maximum supported texture size. Requested was (4480, 2520), maximum extent for either dimension is 4096.


Stack:

Error
    at imports.wbg.__wbg_new_abda76e883ba8a5f (https://bevy-webgl2-examples.pages.dev/3D%20Rendering/3d-scene/wasm_example.js:1869:21)
    at https://bevy-webgl2-examples.pages.dev/3D%20Rendering/3d-scene/wasm_example_bg.wasm:wasm-function[53132]:0x125c108
    at https://bevy-webgl2-examples.pages.dev/3D%20Rendering/3d-scene/wasm_example_bg.wasm:wasm-function[15774]:0xfa878b
    at https://bevy-webgl2-examples.pages.dev/3D%20Rendering/3d-scene/wasm_example_bg.wasm:wasm-function[26849]:0x1177b99
    at https://bevy-webgl2-examples.pages.dev/3D%20Rendering/3d-scene/wasm_example_bg.wasm:wasm-function[22765]:0x109e733
    at https://bevy-webgl2-examples.pages.dev/3D%20Rendering/3d-scene/wasm_example_bg.wasm:wasm-function[9796]:0xd5761c
    at https://bevy-webgl2-examples.pages.dev/3D%20Rendering/3d-scene/wasm_example_bg.wasm:wasm-function[3380]:0x83cab6
    at https://bevy-webgl2-examples.pages.dev/3D%20Rendering/3d-scene/wasm_example_bg.wasm:wasm-function[51476]:0x124c632
    at https://bevy-webgl2-examples.pages.dev/3D%20Rendering/3d-scene/wasm_example_bg.wasm:wasm-function[2077]:0x6eced3
    at https://bevy-webgl2-examples.pages.dev/3D%20Rendering/3d-scene/wasm_example_bg.wasm:wasm-function[14528]:0xf1ac5d

Image

If you look at it from the browser's debugging page, it's normal, but I don't know why the progress bar doesn't disappear.

Image

It's the same with 2D

Image

@mockersf
Copy link
Member

The fact that it crashes is because of the scale factor of your phone. It has a high dpi, and Bevy use that to multiply the texture size which gives in your case something bigger than what your phone GPU supports.

This is a long standing Bevy bug that I thought was fixed, and will changed from phone to phone.

By default, Bevy tries to display in a 1280x720 canvas, which on your phone means a 4480x2520, so you have a 3.5 scale factor. As the maximum texture size is 4096, you can try to change the window size in Bevy on init to be at most 1170 pixel width.

@alice-i-cecile alice-i-cecile added the C-Bug An unexpected or incorrect behavior label Nov 12, 2024
@alice-i-cecile alice-i-cecile transferred this issue from bevyengine/bevy-website Nov 12, 2024
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen O-Android Specific to the Android mobile operating system S-Needs-Investigation This issue requires detective work to figure out what's going wrong and removed O-Android Specific to the Android mobile operating system labels Nov 12, 2024
@alice-i-cecile alice-i-cecile changed the title An error occurred when accessing bevy demo page examples -> 3D Rendering -> 3D Scene on Redmi k60pro mobile phone wgpu crashes on Redmi k60pro mobile phone due to too high of resolution Nov 12, 2024
@alice-i-cecile alice-i-cecile added P-Crash A sudden unexpected crash O-Android Specific to the Android mobile operating system labels Nov 12, 2024
@BenjaminBrienen
Copy link
Contributor

Should the solution be to use the maximum size texture and scale it, or to use two textures, or something else?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior O-Android Specific to the Android mobile operating system P-Crash A sudden unexpected crash S-Needs-Investigation This issue requires detective work to figure out what's going wrong
Projects
None yet
Development

No branches or pull requests

4 participants