diff --git a/crates/render/Cargo.toml b/crates/render/Cargo.toml index 91a28058..2bc6ea3c 100644 --- a/crates/render/Cargo.toml +++ b/crates/render/Cargo.toml @@ -23,7 +23,7 @@ bytemuck = {version = "1", features = ["derive"]} image = {version = "0.25", default-features = false, features = ["png"]} pollster = "0.4" thiserror.workspace = true -wgpu = "29" +wgpu = "30" # Window/interaction (feature = "window"). winit 0.30 and wgpu 29 both use # raw-window-handle 0.6, so an `Arc` satisfies wgpu's surface handle diff --git a/crates/render/src/compute_mesh.rs b/crates/render/src/compute_mesh.rs index 362cb60f..9553f8c6 100644 --- a/crates/render/src/compute_mesh.rs +++ b/crates/render/src/compute_mesh.rs @@ -793,7 +793,7 @@ fn build_draw_resources( vertex: wgpu::VertexState { module: &shader, entry_point: Some("vs_main"), - buffers: &[wgpu::VertexBufferLayout { + buffers: &[Some(wgpu::VertexBufferLayout { array_stride: 28, // 7 words: pos(3) + normal(3) + face_id(1) step_mode: wgpu::VertexStepMode::Vertex, attributes: &[ @@ -813,7 +813,7 @@ fn build_draw_resources( shader_location: 2, }, ], - }], + })], compilation_options: wgpu::PipelineCompilationOptions::default(), }, primitive: wgpu::PrimitiveState { diff --git a/crates/render/src/pipeline.rs b/crates/render/src/pipeline.rs index 10ce5ae3..de4637ae 100644 --- a/crates/render/src/pipeline.rs +++ b/crates/render/src/pipeline.rs @@ -67,6 +67,7 @@ fn candidate_adapters( power_preference: wgpu::PowerPreference::HighPerformance, force_fallback_adapter: false, compatible_surface: surface, + apply_limit_buckets: false, })) { out.push(adapter); @@ -76,6 +77,7 @@ fn candidate_adapters( power_preference: wgpu::PowerPreference::LowPower, force_fallback_adapter: true, compatible_surface: surface, + apply_limit_buckets: false, })) { out.push(adapter); @@ -260,7 +262,7 @@ impl Pipelines { vertex: wgpu::VertexState { module: &mesh_shader, entry_point: Some("vs_main"), - buffers: &[wgpu::VertexBufferLayout { + buffers: &[Some(wgpu::VertexBufferLayout { array_stride: std::mem::size_of::() as wgpu::BufferAddress, step_mode: wgpu::VertexStepMode::Vertex, attributes: &[ @@ -280,7 +282,7 @@ impl Pipelines { shader_location: 2, }, ], - }], + })], compilation_options: wgpu::PipelineCompilationOptions::default(), }, primitive: wgpu::PrimitiveState { @@ -330,7 +332,7 @@ impl Pipelines { vertex: wgpu::VertexState { module: &edge_shader, entry_point: Some("vs_main"), - buffers: &[wgpu::VertexBufferLayout { + buffers: &[Some(wgpu::VertexBufferLayout { array_stride: std::mem::size_of::() as wgpu::BufferAddress, step_mode: wgpu::VertexStepMode::Vertex, attributes: &[wgpu::VertexAttribute { @@ -338,7 +340,7 @@ impl Pipelines { offset: 0, shader_location: 0, }], - }], + })], compilation_options: wgpu::PipelineCompilationOptions::default(), }, primitive: wgpu::PrimitiveState { @@ -713,7 +715,11 @@ pub fn map_and_read(device: &wgpu::Device, buffer: &wgpu::Buffer) -> Result return Err(RenderError::BufferMap(e.to_string())), Err(e) => return Err(RenderError::BufferMap(e.to_string())), } - let data = buffer.slice(..).get_mapped_range().to_vec(); + let data = buffer + .slice(..) + .get_mapped_range() + .map_err(|e| RenderError::BufferMap(e.to_string()))? + .to_vec(); buffer.unmap(); Ok(data) } diff --git a/crates/render/src/viewer.rs b/crates/render/src/viewer.rs index e4b904a9..7e257f81 100644 --- a/crates/render/src/viewer.rs +++ b/crates/render/src/viewer.rs @@ -450,6 +450,7 @@ impl ViewerApp { let config = wgpu::SurfaceConfiguration { usage: wgpu::TextureUsages::RENDER_ATTACHMENT, format, + color_space: wgpu::SurfaceColorSpace::Auto, width, height, // Fifo (vsync) is guaranteed supported by the WebGPU spec; prefer it @@ -550,7 +551,7 @@ impl ViewerApp { ); gpu.queue.submit(Some(encoder.finish())); gpu.window.pre_present_notify(); - frame.present(); + gpu.queue.present(frame); } /// Render the id buffer for the current camera and read the face id under