diff --git a/vello/src/debug.rs b/vello/src/debug.rs index d3327fb5f..d7640d57c 100644 --- a/vello/src/debug.rs +++ b/vello/src/debug.rs @@ -312,8 +312,9 @@ impl DebugRenderer { width: params.width, height: params.height, }; - let uniforms_buf = - ResourceProxy::Buffer(recording.upload_uniform("uniforms", bytemuck::bytes_of(&uniforms))); + let uniforms_buf = ResourceProxy::Buffer( + recording.upload_uniform("uniforms", bytemuck::bytes_of(&uniforms)), + ); let linepoints_uniforms = [ LinepointsUniforms::new(Color::CYAN, 10.), diff --git a/vello/src/lib.rs b/vello/src/lib.rs index 97fb91ca8..db045d114 100644 --- a/vello/src/lib.rs +++ b/vello/src/lib.rs @@ -116,7 +116,8 @@ use thiserror::Error; pub use util::block_on_wgpu; pub use recording::{ - BindType, BufferProxy, Command, ImageFormat, ImageProxy, Recording, ResourceId, ResourceProxy, ShaderId, + BindType, BufferProxy, Command, ImageFormat, ImageProxy, Recording, ResourceId, ResourceProxy, + ShaderId, }; pub use shaders::FullShaders; @@ -219,7 +220,7 @@ pub enum Error { #[cfg(feature = "wgpu")] #[cfg(feature = "debug_layers")] #[error("Failed to download internal buffer for visualization")] - DownloadError(&'static str), + DownloadError(&'static str), #[cfg(feature = "wgpu")] #[error("wgpu Error from scope")] diff --git a/vello/src/wgpu_engine.rs b/vello/src/wgpu_engine.rs index 8835ce036..1643ac481 100644 --- a/vello/src/wgpu_engine.rs +++ b/vello/src/wgpu_engine.rs @@ -10,8 +10,8 @@ use vello_shaders::cpu::CpuBinding; use wgpu::{ BindGroup, BindGroupLayout, Buffer, BufferUsages, CommandEncoder, CommandEncoderDescriptor, - ComputePipeline, Device, PipelineCompilationOptions, Queue, RenderPipeline, Texture, TextureAspect, - TextureUsages, TextureView, TextureViewDimension, + ComputePipeline, Device, PipelineCompilationOptions, Queue, RenderPipeline, Texture, + TextureAspect, TextureUsages, TextureView, TextureViewDimension, }; use crate::{ @@ -599,8 +599,8 @@ impl WgpuEngine { &shader.bind_group_layout, &draw_params.resources, ); - let render_target = - transient_map.materialize_external_image_for_render_pass(&draw_params.target); + let render_target = transient_map + .materialize_external_image_for_render_pass(&draw_params.target); let mut rpass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { label: None, color_attachments: &[Some(wgpu::RenderPassColorAttachment { @@ -634,9 +634,10 @@ impl WgpuEngine { if let Some(proxy) = draw_params.vertex_buffer { // TODO: need a way to materialize a CPU initialized buffer. For now assume // buffer exists? Also, need to materialize this buffer with vertex usage - let buf = self.bind_map.get_gpu_buf(proxy.id).ok_or( - Error::UnavailableBufferUsed(proxy.name, "draw"), - )?; + let buf = self + .bind_map + .get_gpu_buf(proxy.id) + .ok_or(Error::UnavailableBufferUsed(proxy.name, "draw"))?; rpass.set_vertex_buffer(0, buf.slice(..)); } rpass.set_bind_group(0, &bind_group, &[]); @@ -1141,11 +1142,11 @@ impl<'a> TransientBindMap<'a> { for resource in bindings { match resource { ResourceProxy::Buffer(proxy) - | ResourceProxy::BufferRange { - proxy, - offset: _, - size: _, - } => match self.bufs.get(&proxy.id) { + | ResourceProxy::BufferRange { + proxy, + offset: _, + size: _, + } => match self.bufs.get(&proxy.id) { Some(TransientBuf::Cpu(_)) => (), Some(TransientBuf::Gpu(_)) => panic!("buffer was already materialized on GPU"), _ => bind_map.materialize_cpu_buf(proxy), @@ -1161,7 +1162,7 @@ impl<'a> TransientBindMap<'a> { Some(TransientBuf::Cpu(b)) => CpuBinding::Buffer(b), _ => bind_map.get_cpu_buf(buf.id), }, - ResourceProxy::BufferRange { .. } => todo!(), + ResourceProxy::BufferRange { .. } => todo!(), ResourceProxy::Image(_) => todo!(), }) .collect()