-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Description
Bevy version
0.6.0
Operating system & version
Windows 10 (but issue is independent)
What you did
Run any app on Windows 10 NVIDIA GeForce RTX 2070 with Vulkan.
What you expected to happen
No warning.
What actually happened
WARN wgpu_core::instance: Feature MAPPABLE_PRIMARY_BUFFERS enabled on a discrete gpu. This is a massive performance footgun and likely not what you wanted
Additional information
I tried setting explicitly Features::MAPPABLE_PRIMARY_BUFFERS off in WgpuOptions, without success.
Eventually I ran under debugger and found that the default WgpuOptionsPriority value is Functionality, which in bevy_render while creating device will override any app's setting with those of the selected adapter:
bevy/crates/bevy_render/src/renderer/mod.rs
Lines 88 to 92 in 8e1f660
| if matches!(options.priority, WgpuOptionsPriority::Functionality) { | |
| options.features = | |
| adapter.features() | wgpu::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES; | |
| options.limits = adapter.limits(); | |
| } |
While this makes sense for a lot of those settings, like the various hardware limits, this makes no sense for several flags which being reported by adapter.features() only inform the app that the GPU supports the feature, but in no way was intended to tell the app that this is an optimal feature to use. This is the case in particular for MAPPABLE_PRIMARY_BUFFERS which is supported on an RTX 2070 but as the warning shows is strongly discouraged. Yet the bevy_render code simply set options.features = adapter.features() indiscriminately.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status