Update to wgpu 0.13

This commit is contained in:
grovesNL 2022-07-13 09:34:49 -02:30 committed by Josh Groves
parent bbc5f18cdd
commit 3c7789cd3b
3 changed files with 7 additions and 7 deletions

View file

@ -8,7 +8,7 @@ repository = "https://github.com/grovesNL/glyphon"
license = "MIT OR Apache-2.0 OR Zlib"
[dependencies]
wgpu = { git = "https://github.com/gfx-rs/wgpu", rev = "8e62ca0" }
wgpu = "0.13.1"
fontdue = "0.7.2"
etagere = "0.2.6"

View file

@ -56,7 +56,7 @@ async fn run() {
let window = Window::new(&event_loop).unwrap();
let surface = unsafe { instance.create_surface(&window) };
let size = window.inner_size();
let swapchain_format = surface.get_preferred_format(&adapter).unwrap();
let swapchain_format = surface.get_supported_formats(&adapter)[0];
let mut config = SurfaceConfiguration {
usage: TextureUsages::RENDER_ATTACHMENT,
format: swapchain_format,
@ -127,14 +127,14 @@ async fn run() {
{
let mut pass = encoder.begin_render_pass(&RenderPassDescriptor {
label: None,
color_attachments: &[RenderPassColorAttachment {
color_attachments: &[Some(RenderPassColorAttachment {
view: &view,
resolve_target: None,
ops: Operations {
load: LoadOp::Clear(wgpu::Color::BLACK),
store: true,
},
}],
})],
depth_stencil_attachment: None,
});

View file

@ -170,7 +170,7 @@ impl TextAtlas {
let glyph_cache = RecentlyUsedMap::new();
// Create a render pipeline to use for rendering later
let shader = device.create_shader_module(&ShaderModuleDescriptor {
let shader = device.create_shader_module(ShaderModuleDescriptor {
label: Some("glyphon shader"),
source: ShaderSource::Wgsl(Cow::Borrowed(include_str!("shader.wgsl"))),
});
@ -285,11 +285,11 @@ impl TextAtlas {
fragment: Some(FragmentState {
module: &shader,
entry_point: "fs_main",
targets: &[ColorTargetState {
targets: &[Some(ColorTargetState {
format,
blend: Some(BlendState::PREMULTIPLIED_ALPHA_BLENDING),
write_mask: ColorWrites::default(),
}],
})],
}),
primitive: PrimitiveState::default(),
depth_stencil: None,