Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
armansito committed Feb 20, 2024
1 parent c3bd325 commit db06e9b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ impl Recording {
self.push(Command::DispatchIndirect(shader, buf, offset, r));
}

#[allow(clippy::too_many_arguments)]
pub fn draw<R>(
&mut self,
shader_id: ShaderId,
Expand Down
9 changes: 4 additions & 5 deletions src/wgpu_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ impl WgpuEngine {
})
}

// TODO: document limitations
#[allow(clippy::too_many_arguments)]
pub fn add_render_shader(
&mut self,
device: &Device,
Expand All @@ -221,8 +221,7 @@ impl WgpuEngine {
vertex_buffer: Option<wgpu::VertexBufferLayout>,
bind_layout: &[(BindType, wgpu::ShaderStages)],
) -> ShaderId {
let bind_group_layout =
Self::create_bind_group_layout(device, bind_layout.iter().map(|e| *e));
let bind_group_layout = Self::create_bind_group_layout(device, bind_layout.iter().copied());
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
label: None,
bind_group_layouts: &[&bind_group_layout],
Expand Down Expand Up @@ -519,7 +518,7 @@ impl WgpuEngine {
let mut rpass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor {
label: None,
color_attachments: &[Some(wgpu::RenderPassColorAttachment {
view: &render_target,
view: render_target,
resolve_target: None,
ops: wgpu::Operations {
load: match clear_color {
Expand All @@ -541,7 +540,7 @@ impl WgpuEngine {
let PipelineState::Render(pipeline) = &shader.pipeline else {
panic!("cannot issue a draw with a compute pipeline");
};
rpass.set_pipeline(&pipeline);
rpass.set_pipeline(pipeline);
if let Some(proxy) = 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
Expand Down

0 comments on commit db06e9b

Please sign in to comment.