From c8d787b344c3bbd2b80cec96b990c714cc1b51c5 Mon Sep 17 00:00:00 2001 From: Antoine Date: Tue, 26 Mar 2024 23:11:43 +0100 Subject: [PATCH] Fix unused imports --- src/gfx/graphic_pass.rs | 6 ++++-- src/gfx/mod.rs | 8 -------- src/graph/nodes/graphic_pass_node.rs | 4 +--- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/gfx/graphic_pass.rs b/src/gfx/graphic_pass.rs index dc47f1c..fb4c455 100644 --- a/src/gfx/graphic_pass.rs +++ b/src/gfx/graphic_pass.rs @@ -290,12 +290,14 @@ impl GraphicPass { } self.desc.shader_resource_view[index as usize] = srv; } - pub fn set_render_target(&mut self, index: u32, rt : &AttachmentDescription) { + pub fn set_render_target(&mut self, index: u32, width : u32, height: u32) { + let mut rt = AttachmentDescription::default(); + rt.set_size(width, height); if index as usize >= self.desc.render_target_desc.len() { self.desc.render_target_desc.resize(index as usize + 1, AttachmentDescription::default()); self.dirty = true; } - if self.desc.render_target_desc[index as usize] != *rt { + if self.desc.render_target_desc[index as usize] != rt { self.desc.render_target_desc[index as usize] = rt.clone(); self.dirty = true; } diff --git a/src/gfx/mod.rs b/src/gfx/mod.rs index 9c40735..d225f43 100644 --- a/src/gfx/mod.rs +++ b/src/gfx/mod.rs @@ -33,13 +33,5 @@ pub use self::camera::Camera; pub use self::mesh::Mesh; pub use self::shader::Shader; -pub use self::backbuffer::BackbufferPassDescription; -pub use self::graphic_pass::GraphicPassDescription; -pub use self::graphic_pass::AttachmentDescription; -pub use self::compute_pass::ComputePassDescription; -pub use self::buffer::BufferDescription; -pub use self::texture::TextureDescription; -pub use self::camera::CameraDescription; -pub use self::mesh::MeshDescription; pub use self::mesh::MeshSource; pub use self::mesh::MeshShape; \ No newline at end of file diff --git a/src/graph/nodes/graphic_pass_node.rs b/src/graph/nodes/graphic_pass_node.rs index 6bb4e66..69ed378 100644 --- a/src/graph/nodes/graphic_pass_node.rs +++ b/src/graph/nodes/graphic_pass_node.rs @@ -114,9 +114,7 @@ impl ProtosNode for GraphicPassNode { let num_attachment = 1; for i in 0..num_attachment { // Should gather these informations from a evaluate_output. -> reach output node, read its data & select informations. - let mut desc = gfx::AttachmentDescription::default(); - desc.set_size(available_size.x as u32, available_size.y as u32); - pass.set_render_target(i, &desc); + pass.set_render_target(i, available_size.x as u32, available_size.y as u32); } { let vertex = self.evaluate_input(device, queue, graph, node_id, available_size, GraphicPassNodeInput::VertexShader.to_string(), outputs_cache)?.try_to_shader()?;