Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - bevy_render: Do not automatically enable MAPPABLE_PRIMARY_BUFFERS #3698

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions crates/bevy_render/src/renderer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ pub type RenderQueue = Arc<Queue>;
/// aswell as to create [`WindowSurfaces`](crate::view::window::WindowSurfaces).
pub type RenderInstance = Instance;

/// `wgpu::Features` that are not automatically enabled due to having possibly-negative side effects.
/// `MAPPABLE_PRIMARY_BUFFERS` can have a significant, negative performance impact so should not be
/// automatically enabled.
pub const DEFAULT_DISABLED_WGPU_FEATURES: wgpu::Features = wgpu::Features::MAPPABLE_PRIMARY_BUFFERS;

/// Initializes the renderer by retrieving and preparing the GPU instance, device and queue
/// for the specified backend.
pub async fn initialize_renderer(
Expand All @@ -86,8 +91,9 @@ pub async fn initialize_renderer(
let trace_path = None;

if matches!(options.priority, WgpuOptionsPriority::Functionality) {
options.features =
adapter.features() | wgpu::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES;
options.features = (adapter.features()
| wgpu::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES)
- DEFAULT_DISABLED_WGPU_FEATURES;
options.limits = adapter.limits();
}

Expand Down