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

SOLVED: Error in Surface::configure: Validation Error #17

Closed
sinproject-iwasaki opened this issue Mar 16, 2024 · 3 comments · Fixed by #31
Closed

SOLVED: Error in Surface::configure: Validation Error #17

sinproject-iwasaki opened this issue Mar 16, 2024 · 3 comments · Fixed by #31
Assignees
Labels
bug Something isn't working

Comments

@sinproject-iwasaki
Copy link
Owner

sinproject-iwasaki commented Mar 16, 2024

WASM on Android Chrome
Debug: chrome://inspect/#devices

panicked at /Users/iwasakishinya/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.19.3/src/backend/wgpu_core.rs:724: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 is 4096.


Stack:

Error
    at imports.wbg.__wbg_new_abda76e883ba8a5f (https://ec24-240d-1e-26c-2900-eda0-716e-b850-b1b7.ngrok-free.app/target/wasm_bevy_clock.js:509:21)
    at bevy_clock-27d177bb72093bd4.wasm.console_error_panic_hook::hook::h17a4f86ed8d9eea4 (https://ec24-240d-1e-26c-2900-eda0-716e-b850-b1b7.ngrok-free.app/target/wasm_bevy_clock_bg.wasm:wasm-function[3565]:0x5f14dd)
    at bevy_clock-27d177bb72093bd4.wasm.std::panicking::rust_panic_with_hook::hebfea3be29416bf3 (https://ec24-240d-1e-26c-2900-eda0-716e-b850-b1b7.ngrok-free.app/target/wasm_bevy_clock_bg.wasm:wasm-function[9555]:0x7dde48)
    at bevy_clock-27d177bb72093bd4.wasm.std::panicking::begin_panic_handler::{{closure}}::he30d5f573e3bd13d (https://ec24-240d-1e-26c-2900-eda0-716e-b850-b1b7.ngrok-free.app/target/wasm_bevy_clock_bg.wasm:wasm-function[10747]:0x818f65)
    at bevy_clock-27d177bb72093bd4.wasm.std::sys_common::backtrace::__rust_end_short_backtrace::h4d9537b43a08eca1 (https://ec24-240d-1e-26c-2900-eda0-716e-b850-b1b7.ngrok-free.app/target/wasm_bevy_clock_bg.wasm:wasm-function[44267]:0x9dc60a)
    at bevy_clock-27d177bb72093bd4.wasm.rust_begin_unwind (https://ec24-240d-1e-26c-2900-eda0-716e-b850-b1b7.ngrok-free.app/target/wasm_bevy_clock_bg.wasm:wasm-function[20920]:0x9324dc)
    at bevy_clock-27d177bb72093bd4.wasm.core::panicking::panic_fmt::h3e7880dd798cac83 (https://ec24-240d-1e-26c-2900-eda0-716e-b850-b1b7.ngrok-free.app/target/wasm_bevy_clock_bg.wasm:wasm-function[21520]:0x93bc7b)
    at bevy_clock-27d177bb72093bd4.wasm.wgpu::backend::wgpu_core::ContextWgpuCore::handle_error_fatal::ha92dd16cc6d1cdcc (https://ec24-240d-1e-26c-2900-eda0-716e-b850-b1b7.ngrok-free.app/target/wasm_bevy_clock_bg.wasm:wasm-function[12924]:0x8724d0)
    at bevy_clock-27d177bb72093bd4.wasm.<T as wgpu::context::DynContext>::surface_configure::h55112dad2d8018f5 (https://ec24-240d-1e-26c-2900-eda0-716e-b850-b1b7.ngrok-free.app/target/wasm_bevy_clock_bg.wasm:wasm-function[709]:0x2a89ca)
    at bevy_clock-27d177bb72093bd4.wasm.bevy_render::renderer::render_device::RenderDevice::configure_surface::hd2d4b6aee74eba0b (https://ec24-240d-1e-26c-2900-eda0-716e-b850-b1b7.ngrok-free.app/target/wasm_bevy_clock_bg.wasm:wasm-function[9785]:0x7e91d9)
wasm_bevy_clock_bg.wasm:0x9de0bc Uncaught RuntimeError: unreachable
    at bevy_clock-27d177bb72093bd4.wasm.rust_panic (wasm_bevy_clock_bg.wasm:0x9de0bc)
    at bevy_clock-27d177bb72093bd4.wasm.std::panicking::rust_panic_with_hook::hebfea3be29416bf3 (wasm_bevy_clock_bg.wasm:0x7dde74)
    at bevy_clock-27d177bb72093bd4.wasm.std::panicking::begin_panic_handler::{{closure}}::he30d5f573e3bd13d (wasm_bevy_clock_bg.wasm:0x818f65)
    at bevy_clock-27d177bb72093bd4.wasm.std::sys_common::backtrace::__rust_end_short_backtrace::h4d9537b43a08eca1 (wasm_bevy_clock_bg.wasm:0x9dc60a)
    at bevy_clock-27d177bb72093bd4.wasm.rust_begin_unwind (wasm_bevy_clock_bg.wasm:0x9324dc)
    at bevy_clock-27d177bb72093bd4.wasm.core::panicking::panic_fmt::h3e7880dd798cac83 (wasm_bevy_clock_bg.wasm:0x93bc7b)
    at bevy_clock-27d177bb72093bd4.wasm.wgpu::backend::wgpu_core::ContextWgpuCore::handle_error_fatal::ha92dd16cc6d1cdcc (wasm_bevy_clock_bg.wasm:0x8724d0)
    at bevy_clock-27d177bb72093bd4.wasm.<T as wgpu::context::DynContext>::surface_configure::h55112dad2d8018f5 (wasm_bevy_clock_bg.wasm:0x2a89ca)
    at bevy_clock-27d177bb72093bd4.wasm.bevy_render::renderer::render_device::RenderDevice::configure_surface::hd2d4b6aee74eba0b (wasm_bevy_clock_bg.wasm:0x7e91d9)
    at bevy_clock-27d177bb72093bd4.wasm.<bevy_ecs::system::function_system::FunctionSystem<Marker,F> as bevy_ecs::system::system::System>::run_unsafe::hbfbe4dd7b9967568 (wasm_bevy_clock_bg.wasm:0x2bde86)
@sinproject-iwasaki sinproject-iwasaki added the bug Something isn't working label Mar 16, 2024
@sinproject-iwasaki
Copy link
Owner Author

sinproject-iwasaki commented Mar 16, 2024

@sinproject-iwasaki
Copy link
Owner Author

sinproject-iwasaki commented Mar 16, 2024

Solution for this issue

Bevy-created WASM projects fail to operate on devices such as the Pixel 6 Pro, as they exceed the texture size limit. This could potentially be the first-ever solution to this issue.

This worked on Pixel 6 Pro!
GitHub Pages: Link

Set scale_factor_override

pub fn get_plugins() -> PluginGroupBuilder {
    DefaultPlugins.set(WindowPlugin {
        primary_window: Some(Window {
            resolution: WindowResolution::new(800., 600.).with_scale_factor_override(1.0),
            ..default()
        }),
        ..default()
    })
}

...

app..add_plugins(get_plugins())

Set viewport scale to index.html

<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  </head>
</html>
Screenshot 2024-03-16 at 16 17 51

sinproject-iwasaki added a commit that referenced this issue Mar 16, 2024
Error in Surface::configure: Validation Error #17
@sinproject-iwasaki sinproject-iwasaki self-assigned this Mar 16, 2024
@sinproject-iwasaki sinproject-iwasaki changed the title Error in Surface::configure: Validation Error SOLVED: Error in Surface::configure: Validation Error Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant