bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
36.46k stars 3.6k forks source link

Strange behavior on PinePhone Pro #12809

Open Shatur opened 8 months ago

Shatur commented 8 months ago

Bevy version

v0.13.1

[Optional] Relevant system information

Adapter Gl AdapterInfo { name: "Mali-T860 (Panfrost)", vendor: 65541, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Gl }

Phone specs. More detailed CPU specs.

What you did

I trying to run examples from the Bevy repo.

What went wrong

If I try to any example like this:

cargo run --example sprite --features=wayland

I have the following error:

Handling wgpu errors as fatal by default    
thread 'main' panicked at /home/shatur/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.19.3/src/backend/wgpu_core.rs:3006:5:
wgpu error: Validation Error

Caused by:
    In Device::create_bind_group_layout
      note: label = `mesh2d_layout`
    Binding 0 entry is invalid
    Downlevel flags DownlevelFlags(VERTEX_STORAGE) are required but not supported on the device.
This is not an invalid use of WebGPU: the underlying API or device does not support enough features to be a fully compliant implementation. A subset of the features can still be used. If you are running this program on native and not in a browser and wish to work around this issue, call Adapter::downlevel_properties or Device::downlevel_properties to get a listing of the features the current platform supports.

In order to fix it I set WGPU_SETTINGS_PRIO=webgl2 environment variable.

Now all 2D examples work, I can run sprite or breakout examples without issues.

But when I try to run any 3D example like this:

WGPU_SETTINGS_PRIO=webgl2 cargo run --example 3d_scene --features=wayland

It crashes with the following output: log.txt

Additional information

My setup:

PXL_20240331_131214326 MP

JMS55 commented 8 months ago

Hard to tell from the lack of info in the logs, but if I had to guess, your GPU crashed.

Shatur commented 8 months ago

How can I provide more information about the issue?

rmader commented 8 months ago

This part of the log:

Caused by:
    In Device::create_render_pipeline
      note: label = `pbr_opaque_mesh_pipeline`
    Internal error in ShaderStages(FRAGMENT) shader: 0:2(12): error: extension `GL_EXT_texture_cube_map_array' unsupported in fragment shader

looks weird - it's a GLES 3.2 / GL 4.0 feature, not supported by Panfrost yet (neither GL_OES_texture_cube_map_array nor GL_ARB_texture_cube_map_array) and isn't required for webgl2. AFAIK webgl2 should even work with GLES 3.0.

Shatur commented 8 months ago

Interesting... @superdump maybe you have an idea why it happens?

superdump commented 8 months ago

I think we need to expose: https://docs.rs/wgpu/latest/wgpu/struct.DownlevelCapabilities.html and use it for various parts of feature detection logic.