Update wgpu to 0.15

This commit is contained in:
Héctor Ramón Jiménez 2023-04-08 04:15:59 +02:00 committed by Josh Groves
parent b9430c39b6
commit ddaaae295c
3 changed files with 9 additions and 7 deletions

View file

@ -8,7 +8,7 @@ repository = "https://github.com/grovesNL/glyphon"
license = "MIT OR Apache-2.0 OR Zlib" license = "MIT OR Apache-2.0 OR Zlib"
[dependencies] [dependencies]
wgpu = "0.14.0" wgpu = "0.15"
etagere = "0.2.6" etagere = "0.2.6"
cosmic-text = "0.8" cosmic-text = "0.8"
lru = "0.9" lru = "0.9"

View file

@ -3,10 +3,10 @@ use glyphon::{
TextBounds, TextRenderer, TextBounds, TextRenderer,
}; };
use wgpu::{ use wgpu::{
Backends, CommandEncoderDescriptor, CompositeAlphaMode, DeviceDescriptor, Features, Instance, CommandEncoderDescriptor, CompositeAlphaMode, DeviceDescriptor, Features, Instance,
Limits, LoadOp, MultisampleState, Operations, PresentMode, RenderPassColorAttachment, InstanceDescriptor, Limits, LoadOp, MultisampleState, Operations, PresentMode,
RenderPassDescriptor, RequestAdapterOptions, SurfaceConfiguration, TextureFormat, RenderPassColorAttachment, RenderPassDescriptor, RequestAdapterOptions, SurfaceConfiguration,
TextureUsages, TextureViewDescriptor, TextureFormat, TextureUsages, TextureViewDescriptor,
}; };
use winit::{ use winit::{
dpi::LogicalSize, dpi::LogicalSize,
@ -32,7 +32,7 @@ async fn run() {
let scale_factor = window.scale_factor(); let scale_factor = window.scale_factor();
// Set up surface // Set up surface
let instance = Instance::new(Backends::all()); let instance = Instance::new(InstanceDescriptor::default());
let adapter = instance let adapter = instance
.request_adapter(&RequestAdapterOptions::default()) .request_adapter(&RequestAdapterOptions::default())
.await .await
@ -48,7 +48,7 @@ async fn run() {
) )
.await .await
.unwrap(); .unwrap();
let surface = unsafe { instance.create_surface(&window) }; let surface = unsafe { instance.create_surface(&window) }.expect("Create surface");
let swapchain_format = TextureFormat::Bgra8UnormSrgb; let swapchain_format = TextureFormat::Bgra8UnormSrgb;
let mut config = SurfaceConfiguration { let mut config = SurfaceConfiguration {
usage: TextureUsages::RENDER_ATTACHMENT, usage: TextureUsages::RENDER_ATTACHMENT,
@ -57,6 +57,7 @@ async fn run() {
height: size.height, height: size.height,
present_mode: PresentMode::Fifo, present_mode: PresentMode::Fifo,
alpha_mode: CompositeAlphaMode::Opaque, alpha_mode: CompositeAlphaMode::Opaque,
view_formats: vec![],
}; };
surface.configure(&device, &config); surface.configure(&device, &config);

View file

@ -49,6 +49,7 @@ impl InnerAtlas {
_ => panic!("unexpected number of channels"), _ => panic!("unexpected number of channels"),
}, },
usage: TextureUsages::TEXTURE_BINDING | TextureUsages::COPY_DST, usage: TextureUsages::TEXTURE_BINDING | TextureUsages::COPY_DST,
view_formats: &[],
}); });
let texture_view = texture.create_view(&TextureViewDescriptor::default()); let texture_view = texture.create_view(&TextureViewDescriptor::default());