Upgrade to wgpu 0.13 (#142)

This commit is contained in:
Max Ammann 2022-07-04 10:26:09 +02:00 committed by GitHub
parent 2b13668727
commit 8018e76c80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 11 deletions

View File

@ -50,9 +50,7 @@ geozero = { version = "0.9.4", default-features = false, features = ["with-mvt",
tile-grid = "0.3"
# Rendering
wgpu = { git = "https://github.com/gfx-rs/wgpu.git", branch = "master" }
wgpu-core = { git = "https://github.com/gfx-rs/wgpu.git", branch = "master" }
wgpu-hal = { git = "https://github.com/gfx-rs/wgpu.git", branch = "master" }
wgpu = "0.13.0"
lyon = { version = "0.17", features = [] }
raw-window-handle = "0.4"

View File

@ -82,7 +82,7 @@ impl Node for MainPassNode {
.command_encoder
.begin_render_pass(&wgpu::RenderPassDescriptor {
label: None,
color_attachments: &[color_attachment],
color_attachments: &[Some(color_attachment)],
depth_stencil_attachment: Some(wgpu::RenderPassDepthStencilAttachment {
view: &depth_texture.view,
depth_ops: Some(wgpu::Operations {

View File

@ -344,6 +344,9 @@ impl Renderer {
max_compute_workgroups_per_dimension: limits
.max_compute_workgroups_per_dimension
.min(constrained_limits.max_compute_workgroups_per_dimension),
max_buffer_size: limits
.max_buffer_size
.min(constrained_limits.max_buffer_size),
};
}

View File

@ -45,11 +45,11 @@ impl RenderPipelineDescriptor {
..Default::default()
});
let vertex_shader_module = device.create_shader_module(&wgpu::ShaderModuleDescriptor {
let vertex_shader_module = device.create_shader_module(wgpu::ShaderModuleDescriptor {
label: None,
source: wgpu::ShaderSource::Wgsl(self.vertex.source.into()),
});
let fragment_shader_module = device.create_shader_module(&wgpu::ShaderModuleDescriptor {
let fragment_shader_module = device.create_shader_module(wgpu::ShaderModuleDescriptor {
label: None,
source: wgpu::ShaderSource::Wgsl(self.fragment.source.into()),
});

View File

@ -20,7 +20,7 @@ pub struct FragmentState {
/// function with this name in the shader.
pub entry_point: &'static str,
/// The color state of the render targets.
pub targets: Vec<wgpu::ColorTargetState>,
pub targets: Vec<Option<wgpu::ColorTargetState>>,
}
#[derive(Clone, Debug)]

View File

@ -65,7 +65,7 @@ impl Shader for TileMaskShader {
FragmentState {
source: include_str!("tile_mask.fragment.wgsl"),
entry_point: "main",
targets: vec![wgpu::ColorTargetState {
targets: vec![Some(wgpu::ColorTargetState {
format: self.format,
blend: None,
write_mask: if self.draw_colors {
@ -73,7 +73,7 @@ impl Shader for TileMaskShader {
} else {
wgpu::ColorWrites::empty()
},
}],
})],
}
}
}
@ -175,7 +175,7 @@ impl Shader for TileShader {
FragmentState {
source: include_str!("tile.fragment.wgsl"),
entry_point: "main",
targets: vec![wgpu::ColorTargetState {
targets: vec![Some(wgpu::ColorTargetState {
format: self.format,
/*blend: Some(wgpu::BlendState {
color: wgpu::BlendComponent {
@ -191,7 +191,7 @@ impl Shader for TileShader {
}),*/
blend: None,
write_mask: wgpu::ColorWrites::ALL,
}],
})],
}
}
}