mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
[rs] Merge #606
606: Enable GL backend r=kvark a=kvark Replaces #182 Depends on https://github.com/gfx-rs/wgpu/pull/907 Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
This commit is contained in:
@@ -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"
|
||||
@@ -91,6 +91,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" }
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user