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] - enable wgpu device features #547

Closed
wants to merge 9 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/master' into wgpu_device_features
# Conflicts:
#	crates/bevy_wgpu/src/wgpu_renderer.rs
  • Loading branch information
verzuz committed Feb 1, 2021
commit 1ef36465757956750aeea14647635fb24c024e60
12 changes: 11 additions & 1 deletion crates/bevy_wgpu/src/wgpu_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,16 @@ pub struct WgpuRenderer {

impl WgpuRenderer {
pub async fn new(options: WgpuOptions, features : wgpu::Features) -> Self {
let instance = wgpu::Instance::new(wgpu::BackendBit::PRIMARY);
let backend = match options.backend {
WgpuBackend::Auto => wgpu::BackendBit::PRIMARY,
WgpuBackend::Vulkan => wgpu::BackendBit::VULKAN,
WgpuBackend::Metal => wgpu::BackendBit::METAL,
WgpuBackend::Dx12 => wgpu::BackendBit::DX12,
WgpuBackend::Dx11 => wgpu::BackendBit::DX11,
WgpuBackend::GL => wgpu::BackendBit::GL,
WgpuBackend::BrowserWgpu => wgpu::BackendBit::BROWSER_WEBGPU,
};
let instance = wgpu::Instance::new(backend);

let adapter = instance
.request_adapter(&wgpu::RequestAdapterOptions {
Expand All @@ -44,6 +53,7 @@ impl WgpuRenderer {
let (device, queue) = adapter
.request_device(
&wgpu::DeviceDescriptor {
label: None,
features: features,
limits: wgpu::Limits::default(),
},
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.