diff --git a/maplibre/Cargo.toml b/maplibre/Cargo.toml index 410d452f..876ac0e5 100644 --- a/maplibre/Cargo.toml +++ b/maplibre/Cargo.toml @@ -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" diff --git a/maplibre/src/render/main_pass.rs b/maplibre/src/render/main_pass.rs index 48c95bd9..3b918254 100644 --- a/maplibre/src/render/main_pass.rs +++ b/maplibre/src/render/main_pass.rs @@ -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 { diff --git a/maplibre/src/render/mod.rs b/maplibre/src/render/mod.rs index fb8e7474..1597b8ab 100644 --- a/maplibre/src/render/mod.rs +++ b/maplibre/src/render/mod.rs @@ -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), }; } diff --git a/maplibre/src/render/resource/pipeline.rs b/maplibre/src/render/resource/pipeline.rs index 70733b76..d16edafa 100644 --- a/maplibre/src/render/resource/pipeline.rs +++ b/maplibre/src/render/resource/pipeline.rs @@ -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()), }); diff --git a/maplibre/src/render/resource/shader.rs b/maplibre/src/render/resource/shader.rs index e4d0efc7..e288cd99 100644 --- a/maplibre/src/render/resource/shader.rs +++ b/maplibre/src/render/resource/shader.rs @@ -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, + pub targets: Vec>, } #[derive(Clone, Debug)] diff --git a/maplibre/src/render/shaders/mod.rs b/maplibre/src/render/shaders/mod.rs index 76e6fb7c..b3022210 100644 --- a/maplibre/src/render/shaders/mod.rs +++ b/maplibre/src/render/shaders/mod.rs @@ -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, - }], + })], } } }