bevyengine / bevyengine/bevy

Pipelined Rendering: bevy does not request surface compatibility from wgpu

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

Description

## Bevy version

pipelined-rendering HEAD

## Operating system & version

Ubuntu 20.04

## What you did

* Set prime to intel-only mode
* `cargo run --example 3d_scene_pipelined`

## What you expected to happen

`3d_scene_pipelined` demo to be rendered on the Intel GPU

## What actually happened

```
thread 'main' panicked at 'Error in Surface::configure: surface does not support the adapter's queue family', /home/branan/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.11.0/src/backend/direct.rs:204:9
```

## Additional information
The reason that wgpu selects the intel GPU even though it cannot present to it is because Bevy does not request [surface compatibility](https://docs.rs/wgpu/0.11.0/wgpu/struct.RequestAdapterOptionsBase.html#structfield.compatible_surface) when initializing the wgpu adapter.

This happens in my case because wgpu is [overly-aggressive in disabling presentation on Intel GPUs on systems with prime/optimus](https://github.com/gfx-rs/wgpu/issues/2129). However, I believe that this lack of an explicit compatibility check could potentially cause wgpu to select an incorrect Vulkan device in other situations where there are GPUs which cannot present.

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.