Merge pull request #1462 from wyatt-herkamp/master

Update `wgpu` to `0.14` and `wgpu_glyph` to `0.18`
This commit is contained in:
Héctor Ramón 2022-11-01 19:53:03 +01:00 committed by GitHub
commit 37c5b15f62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 11 deletions

View file

@ -119,6 +119,7 @@ pub fn main() {
width: physical_size.width, width: physical_size.width,
height: physical_size.height, height: physical_size.height,
present_mode: wgpu::PresentMode::AutoVsync, present_mode: wgpu::PresentMode::AutoVsync,
alpha_mode: wgpu::CompositeAlphaMode::Auto,
}, },
); );
@ -213,6 +214,7 @@ pub fn main() {
width: size.width, width: size.width,
height: size.height, height: size.height,
present_mode: wgpu::PresentMode::AutoVsync, present_mode: wgpu::PresentMode::AutoVsync,
alpha_mode: wgpu::CompositeAlphaMode::Auto
}, },
); );

View file

@ -20,7 +20,7 @@ opengl = []
[dependencies] [dependencies]
glam = "0.10" glam = "0.10"
raw-window-handle = "0.4" raw-window-handle = "0.5"
thiserror = "1.0" thiserror = "1.0"
[dependencies.bytemuck] [dependencies.bytemuck]

View file

@ -2,7 +2,7 @@
//! surfaces. //! surfaces.
use crate::{Color, Error, Viewport}; use crate::{Color, Error, Viewport};
use raw_window_handle::HasRawWindowHandle; use raw_window_handle::{HasRawDisplayHandle, HasRawWindowHandle};
use thiserror::Error; use thiserror::Error;
/// A graphics compositor that can draw to windows. /// A graphics compositor that can draw to windows.
@ -17,7 +17,7 @@ pub trait Compositor: Sized {
type Surface; type Surface;
/// Creates a new [`Compositor`]. /// Creates a new [`Compositor`].
fn new<W: HasRawWindowHandle>( fn new<W: HasRawWindowHandle + HasRawDisplayHandle>(
settings: Self::Settings, settings: Self::Settings,
compatible_window: Option<&W>, compatible_window: Option<&W>,
) -> Result<(Self, Self::Renderer), Error>; ) -> Result<(Self, Self::Renderer), Error>;
@ -25,7 +25,7 @@ pub trait Compositor: Sized {
/// Crates a new [`Surface`] for the given window. /// Crates a new [`Surface`] for the given window.
/// ///
/// [`Surface`]: Self::Surface /// [`Surface`]: Self::Surface
fn create_surface<W: HasRawWindowHandle>( fn create_surface<W: HasRawWindowHandle + HasRawDisplayHandle>(
&mut self, &mut self,
window: &W, window: &W,
) -> Self::Surface; ) -> Self::Surface;

View file

@ -28,10 +28,10 @@ spirv = ["wgpu/spirv"]
webgl = ["wgpu/webgl"] webgl = ["wgpu/webgl"]
[dependencies] [dependencies]
wgpu = "0.13" wgpu = "0.14"
wgpu_glyph = "0.17" wgpu_glyph = "0.18"
glyph_brush = "0.7" glyph_brush = "0.7"
raw-window-handle = "0.4" raw-window-handle = "0.5"
log = "0.4" log = "0.4"
guillotiere = "0.6" guillotiere = "0.6"
futures = "0.3" futures = "0.3"

View file

@ -4,7 +4,7 @@ use futures::stream::{self, StreamExt};
use iced_graphics::compositor; use iced_graphics::compositor;
use iced_native::futures; use iced_native::futures;
use raw_window_handle::HasRawWindowHandle; use raw_window_handle::{HasRawDisplayHandle, HasRawWindowHandle};
use std::marker::PhantomData; use std::marker::PhantomData;
@ -27,7 +27,7 @@ impl<Theme> Compositor<Theme> {
/// Requests a new [`Compositor`] with the given [`Settings`]. /// Requests a new [`Compositor`] with the given [`Settings`].
/// ///
/// Returns `None` if no compatible graphics adapter could be found. /// Returns `None` if no compatible graphics adapter could be found.
pub async fn request<W: HasRawWindowHandle>( pub async fn request<W: HasRawWindowHandle + HasRawDisplayHandle>(
settings: Settings, settings: Settings,
compatible_window: Option<&W>, compatible_window: Option<&W>,
) -> Option<Self> { ) -> Option<Self> {
@ -123,7 +123,7 @@ impl<Theme> iced_graphics::window::Compositor for Compositor<Theme> {
type Renderer = Renderer<Theme>; type Renderer = Renderer<Theme>;
type Surface = wgpu::Surface; type Surface = wgpu::Surface;
fn new<W: HasRawWindowHandle>( fn new<W: HasRawWindowHandle + HasRawDisplayHandle>(
settings: Self::Settings, settings: Self::Settings,
compatible_window: Option<&W>, compatible_window: Option<&W>,
) -> Result<(Self, Self::Renderer), Error> { ) -> Result<(Self, Self::Renderer), Error> {
@ -138,7 +138,7 @@ impl<Theme> iced_graphics::window::Compositor for Compositor<Theme> {
Ok((compositor, Renderer::new(backend))) Ok((compositor, Renderer::new(backend)))
} }
fn create_surface<W: HasRawWindowHandle>( fn create_surface<W: HasRawWindowHandle + HasRawDisplayHandle>(
&mut self, &mut self,
window: &W, window: &W,
) -> wgpu::Surface { ) -> wgpu::Surface {
@ -162,6 +162,7 @@ impl<Theme> iced_graphics::window::Compositor for Compositor<Theme> {
present_mode: self.settings.present_mode, present_mode: self.settings.present_mode,
width, width,
height, height,
alpha_mode: wgpu::CompositeAlphaMode::Auto,
}, },
); );
} }