diff --git a/Cargo.toml b/Cargo.toml index 87ddc86996..6981457ed4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,14 +28,14 @@ vulkan = ["wgc/gfx-backend-vulkan"] package = "wgpu-core" version = "0.5" git = "https://github.com/gfx-rs/wgpu" -rev = "f64b2dd3bb9e11c1dfc0eb3be44fbaae81b18c7b" +rev = "bee826e79dcbe11b544296179a6bbb2c05d9639b" features = ["raw-window-handle"] [dependencies.wgt] package = "wgpu-types" version = "0.5" git = "https://github.com/gfx-rs/wgpu" -rev = "f64b2dd3bb9e11c1dfc0eb3be44fbaae81b18c7b" +rev = "bee826e79dcbe11b544296179a6bbb2c05d9639b" [dependencies] arrayvec = "0.5" @@ -57,9 +57,11 @@ name="hello-compute" path="examples/hello-compute/main.rs" test = true -[patch.crates-io] +[patch."https://github.com/gfx-rs/wgpu"] #wgpu-types = { version = "0.5.0", path = "../wgpu/wgpu-types" } #wgpu-core = { version = "0.5.0", path = "../wgpu/wgpu-core" } + +[patch.crates-io] #gfx-hal = { version = "0.5.0", path = "../gfx/src/hal" } #gfx-backend-empty = { version = "0.5.0", path = "../gfx/src/backend/empty" } #gfx-backend-vulkan = { version = "0.5.0", path = "../gfx/src/backend/vulkan" } diff --git a/src/backend/direct.rs b/src/backend/direct.rs index 52263a436e..24794b7cfb 100644 --- a/src/backend/direct.rs +++ b/src/backend/direct.rs @@ -224,7 +224,7 @@ impl crate::Context for Context { fn instance_create_surface( &self, - handle: raw_window_handle::RawWindowHandle, + handle: &impl raw_window_handle::HasRawWindowHandle, ) -> Self::SurfaceId { self.instance_create_surface(handle, PhantomData) } diff --git a/src/backend/web.rs b/src/backend/web.rs index 893cebefb7..50a2929b58 100644 --- a/src/backend/web.rs +++ b/src/backend/web.rs @@ -605,9 +605,9 @@ impl crate::Context for Context { fn instance_create_surface( &self, - handle: raw_window_handle::RawWindowHandle, + handle: &impl raw_window_handle::HasRawWindowHandle, ) -> Self::SurfaceId { - let canvas_attribute = match handle { + let canvas_attribute = match handle.raw_window_handle() { raw_window_handle::RawWindowHandle::Web(web_handle) => web_handle.id, _ => panic!("expected valid handle for canvas"), }; diff --git a/src/lib.rs b/src/lib.rs index 954a44cc94..6c9db50a72 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -119,7 +119,7 @@ trait Context: Sized { fn init() -> Self; fn instance_create_surface( &self, - handle: raw_window_handle::RawWindowHandle, + handle: &impl raw_window_handle::HasRawWindowHandle, ) -> Self::SurfaceId; fn instance_request_adapter( &self, @@ -899,7 +899,7 @@ impl Instance { window: &W, ) -> Surface { Surface { - id: Context::instance_create_surface(&*self.context, window.raw_window_handle()), + id: Context::instance_create_surface(&*self.context, window), } }