[rs] Enable GL backend

This commit is contained in:
Dzmitry Malyshau
2020-11-04 23:02:01 -05:00
parent bcaae6a962
commit 58d2b36d13
6 changed files with 8 additions and 7 deletions

View File

@@ -26,14 +26,14 @@ vulkan-portability = ["wgc/gfx-backend-vulkan", "gfx-backend-vulkan"]
package = "wgpu-core"
#version = "0.6"
git = "https://github.com/gfx-rs/wgpu"
rev = "7ac706f0a9d90ebdcffeae48e3c530b9921bff2c"
rev = "99ff41bb998d017ca5afdf9a8657cc744dc225d3"
features = ["raw-window-handle"]
[dependencies.wgt]
package = "wgpu-types"
#version = "0.6"
git = "https://github.com/gfx-rs/wgpu"
rev = "7ac706f0a9d90ebdcffeae48e3c530b9921bff2c"
rev = "99ff41bb998d017ca5afdf9a8657cc744dc225d3"
[dependencies]
arrayvec = "0.5"
@@ -88,6 +88,7 @@ test = true
#gfx-hal = { version = "0.6", path = "../gfx/src/hal" }
#gfx-backend-empty = { version = "0.6", path = "../gfx/src/backend/empty" }
#gfx-backend-vulkan = { version = "0.6", path = "../gfx/src/backend/vulkan" }
#gfx-backend-gl = { version = "0.6", path = "../gfx/src/backend/gl" }
#gfx-backend-dx12 = { version = "0.6", path = "../gfx/src/backend/dx12" }
#gfx-backend-dx11 = { version = "0.6", path = "../gfx/src/backend/dx11" }
#gfx-backend-metal = { version = "0.6", path = "../gfx/src/backend/metal" }

View File

@@ -21,8 +21,7 @@ async fn run() {
async fn execute_gpu(numbers: Vec<u32>) -> Vec<u32> {
// Instantiates instance of WebGPU
// 'wgpu::BackendBit::PRIMARY' selects one of 'Vulkan + Metal + DX12 + Browser WebGPU' as the backend
let instance = wgpu::Instance::new(wgpu::BackendBit::PRIMARY);
let instance = wgpu::Instance::new(wgpu::BackendBit::all());
// `request_adapter` instantiates the general connection to the GPU
let adapter = instance

View File

@@ -6,7 +6,7 @@ use winit::{
async fn run(event_loop: EventLoop<()>, window: Window, swapchain_format: wgpu::TextureFormat) {
let size = window.inner_size();
let instance = wgpu::Instance::new(wgpu::BackendBit::PRIMARY);
let instance = wgpu::Instance::new(wgpu::BackendBit::all());
let surface = unsafe { instance.create_surface(&window) };
let adapter = instance
.request_adapter(&wgpu::RequestAdapterOptions {

View File

@@ -67,7 +67,7 @@ async fn run(
viewports: Vec<(Window, wgpu::Color)>,
swapchain_format: wgpu::TextureFormat,
) {
let instance = wgpu::Instance::new(wgpu::BackendBit::PRIMARY);
let instance = wgpu::Instance::new(wgpu::BackendBit::all());
let viewports: Vec<_> = viewports
.into_iter()
.map(|(window, color)| ViewportDesc::new(window, color, &instance))

View File

@@ -1,7 +1,7 @@
/// This example shows how to describe the adapter in use.
async fn run() {
#[cfg_attr(target_arch = "wasm32", allow(unused_variables))]
let adapter = wgpu::Instance::new(wgpu::BackendBit::PRIMARY)
let adapter = wgpu::Instance::new(wgpu::BackendBit::all())
.request_adapter(&wgpu::RequestAdapterOptions::default())
.await
.unwrap();

View File

@@ -45,6 +45,7 @@ impl Context {
.metal
.as_ref()
.map(|inst| inst.create_surface_from_layer(std::mem::transmute(layer))),
gl: None,
};
let id = self.0.surfaces.process_id(PhantomData);