bevyengine / bevyengine/bevy

Depth texture overflows device limits

Open
#4,869 3 comments 1 reaction 0 assignees View on GitHub
A-Rendering A-Windowing C-Bug O-Web
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## Bevy version

0.8.0-dev (d353fbc6ea9e0c4fa69fc3b8e646e1ce79fbbc16)
## 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:
```console
(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:
```rust
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](https://user-images.githubusercontent.com/389782/170893784-10944bab-3ece-4775-ab86-2829f6d6a25c.png)

#### 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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.