Skip to content

Depth texture overflows device limits #4869

@micahscopes

Description

@micahscopes

Bevy version

0.8.0-dev (d353fbc)

Operating system & version

Chrome 101 + Android 8 (LG G8 ThinQ)

What you did

  • Tried opening a simple example application on my phone's browser (compiled Bevy 0.8.0-dev).
  • Tried opening https://bevyengine.org/examples/ on my phone (probably v0.7)

What you expected to happen

I expected to be able to view the examples

What actually happened

The render pipeline failed to initialize the depth buffer texture. It tried creating a texture larger than my device's limits:

(index):869 panicked at 'wgpu error: Validation Error

Caused by:
    In Device::create_texture
      note: label = `view_depth_texture`
    Dimension 4480 value 4480 exceeds the limit of 4096
'

Additional information

My phone's physical resolution is 3120x1440 so I'm not sure why winit is giving Bevy such a large scaling factor. Maybe this is a winit issue?

But even so, if winit is passing an impossible scale factor maybe the renderer should be able to handle it?

When I add:

    app
        .insert_resource(WindowDescriptor {
            scale_factor_override: Some(1.0),
            ..WindowDescriptor::default()
        })

It gets rid of the texture size limitation but totally messes up canvas sizing/resizing:

image

other questions

  • I wonder also if the device rotation is being correctly taken into consideration?
  • If winit is passing wonky large scale factors, wouldn't this potentially cause performance issues on mobile devices by forcing them to render to enormous canvases?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenA-WindowingPlatform-agnostic interface layer to run your app inC-BugAn unexpected or incorrect behaviorO-WebSpecific to web (WASM) builds

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions