Skip to content

Fog crashes on certain mobile devices in WASM #8506

@oscrim

Description

@oscrim

Bevy version

670f3f0

Relevant system information

`AdapterInfo { name: "Adreno (TM) 660", vendor: 20803, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Gl }`

What you did

I ran a basic 3D Shapes example on WASM on my phone.

What went wrong

I expected the example the example to run like it did on my computer but instead it crashes with the error

Shader translation error for stage VERTEX | FRAGMENT | VERTEX_FRAGMENT:  log.target = "wgpu::backend::direct";log.module_path = "wgpu::backend::direct";
panicked at 'wgpu error: Validation Error

Caused by:
    In Device::create_render_pipeline
      note: label = `pbr_opaque_mesh_pipeline`
    Internal error in VERTEX | FRAGMENT | VERTEX_FRAGMENT shader: 

Additional information

I first asked about it on your discord here.

Using git bisect I was able to find the commit that introduced the bug which is 1a96d82.

Further by removing the lines

    if (fog.mode != FOG_MODE_OFF && (material.flags & STANDARD_MATERIAL_FLAGS_FOG_ENABLED_BIT) != 0u) {
        output_color = apply_fog(output_color, in.world_position.xyz, view.world_position.xyz);
    }

in pbr.wgsl, in bevy_pbr, the example once again runs on my phone.

What is interesting however is that my colleague ran it on his phone without issue, his adapter info is the following.

AdapterInfo { name: "Mali-G78", vendor: 5045, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Gl }

Furthermore I tried running it on my tablet which also crashes, I unfortunately cannot read logs from the tablet but it uses the Adreno 619 GPU.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-BugAn unexpected or incorrect behaviorP-CrashA sudden unexpected crash

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions