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" tile-grid = "0.3"
# Rendering # Rendering
wgpu = { git = "https://github.com/gfx-rs/wgpu.git", branch = "master" } wgpu = "0.13.0"
wgpu-core = { git = "https://github.com/gfx-rs/wgpu.git", branch = "master" }
wgpu-hal = { git = "https://github.com/gfx-rs/wgpu.git", branch = "master" }
lyon = { version = "0.17", features = [] } lyon = { version = "0.17", features = [] }
raw-window-handle = "0.4" raw-window-handle = "0.4"

View File

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

View File

@ -344,6 +344,9 @@ impl Renderer {
max_compute_workgroups_per_dimension: limits max_compute_workgroups_per_dimension: limits
.max_compute_workgroups_per_dimension .max_compute_workgroups_per_dimension
.min(constrained_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() ..Default::default()
}); });
let vertex_shader_module = device.create_shader_module(&wgpu::ShaderModuleDescriptor { let vertex_shader_module = device.create_shader_module(wgpu::ShaderModuleDescriptor {
label: None, label: None,
source: wgpu::ShaderSource::Wgsl(self.vertex.source.into()), 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, label: None,
source: wgpu::ShaderSource::Wgsl(self.fragment.source.into()), source: wgpu::ShaderSource::Wgsl(self.fragment.source.into()),
}); });

View File

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

View File

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