Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
armansito authored and DJMcNab committed Jul 29, 2024
1 parent 3b30c2c commit 0cb809c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
5 changes: 3 additions & 2 deletions vello/src/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.),
Expand Down
2 changes: 1 addition & 1 deletion vello/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,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")]
Expand Down
27 changes: 14 additions & 13 deletions vello/src/wgpu_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,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::{
Expand Down Expand Up @@ -631,8 +631,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 {
Expand Down Expand Up @@ -666,9 +666,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, &[]);
Expand Down Expand Up @@ -1173,11 +1174,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),
Expand All @@ -1193,7 +1194,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()
Expand Down

0 comments on commit 0cb809c

Please sign in to comment.