Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/render/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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<Window>` satisfies wgpu's surface handle
Expand Down
4 changes: 2 additions & 2 deletions crates/render/src/compute_mesh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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: &[
Expand All @@ -813,7 +813,7 @@ fn build_draw_resources(
shader_location: 2,
},
],
}],
})],
compilation_options: wgpu::PipelineCompilationOptions::default(),
},
primitive: wgpu::PrimitiveState {
Expand Down
16 changes: 11 additions & 5 deletions crates/render/src/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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::<Vertex>() as wgpu::BufferAddress,
step_mode: wgpu::VertexStepMode::Vertex,
attributes: &[
Expand All @@ -280,7 +282,7 @@ impl Pipelines {
shader_location: 2,
},
],
}],
})],
compilation_options: wgpu::PipelineCompilationOptions::default(),
},
primitive: wgpu::PrimitiveState {
Expand Down Expand Up @@ -330,15 +332,15 @@ 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::<EdgeVertex>() as wgpu::BufferAddress,
step_mode: wgpu::VertexStepMode::Vertex,
attributes: &[wgpu::VertexAttribute {
format: wgpu::VertexFormat::Float32x3,
offset: 0,
shader_location: 0,
}],
}],
})],
compilation_options: wgpu::PipelineCompilationOptions::default(),
},
primitive: wgpu::PrimitiveState {
Expand Down Expand Up @@ -713,7 +715,11 @@ pub fn map_and_read(device: &wgpu::Device, buffer: &wgpu::Buffer) -> Result<Vec<
Ok(Err(e)) => 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)
}
Expand Down
3 changes: 2 additions & 1 deletion crates/render/src/viewer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading