diff --git a/crates/gpui3/src/platform.rs b/crates/gpui3/src/platform.rs index a37ac4fab6..0b1020e199 100644 --- a/crates/gpui3/src/platform.rs +++ b/crates/gpui3/src/platform.rs @@ -155,13 +155,13 @@ pub trait PlatformWindow { unsafe impl<'a> HasRawWindowHandle for &'a dyn PlatformWindow { fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle { - self.raw_window_handle() + (*self).raw_window_handle() } } unsafe impl<'a> HasRawDisplayHandle for &'a dyn PlatformWindow { fn raw_display_handle(&self) -> raw_window_handle::RawDisplayHandle { - self.raw_display_handle() + (*self).raw_display_handle() } } diff --git a/crates/gpui3/src/renderer.rs b/crates/gpui3/src/renderer.rs index 5d5f0e5e60..eed29c93c8 100644 --- a/crates/gpui3/src/renderer.rs +++ b/crates/gpui3/src/renderer.rs @@ -1,6 +1,7 @@ use crate::{DevicePixels, Scene, Size}; use futures::{future::BoxFuture, FutureExt}; use raw_window_handle::{HasRawDisplayHandle, HasRawWindowHandle}; +use wgpu::Backends; pub struct Renderer { device: wgpu::Device, @@ -21,7 +22,10 @@ impl Renderer { where W: RenderTarget, { - let instance = wgpu::Instance::new(Default::default()); + let instance = wgpu::Instance::new(wgpu::InstanceDescriptor { + backends: Backends::METAL, + ..Default::default() + }); let surface = unsafe { instance.create_surface(window).unwrap() }; let width = window.content_device_size().width; let height = window.content_device_size().height; diff --git a/crates/gpui3/src/window.rs b/crates/gpui3/src/window.rs index 6ea41fbb26..18bc650cd6 100644 --- a/crates/gpui3/src/window.rs +++ b/crates/gpui3/src/window.rs @@ -1,11 +1,7 @@ use crate::{ - renderer::Renderer, AvailableSpace, MainThreadOnly, Platform, PlatformWindow, Point, Size, - Style, TextStyle, TextStyleRefinement, WindowOptions, -}; - -use super::{ - px, taffy::LayoutId, AppContext, Bounds, Context, EntityId, Handle, Pixels, Reference, - TaffyLayoutEngine, + px, renderer::Renderer, taffy::LayoutId, AppContext, AvailableSpace, Bounds, Context, EntityId, + Handle, MainThreadOnly, Pixels, Platform, PlatformWindow, Point, Reference, Size, Style, + TaffyLayoutEngine, TextStyle, TextStyleRefinement, WindowOptions, }; use anyhow::Result; use derive_more::{Deref, DerefMut};