diff --git a/src/application.rs b/src/application.rs index ef1fce3f..42ecdd9f 100644 --- a/src/application.rs +++ b/src/application.rs @@ -69,8 +69,8 @@ impl Application { // Temporary setup below, TODO: move to appropriate place in architecture // Window uniform bind group layout - let window_binding_types = vec![wgpu::BindingType::UniformBuffer { dynamic: false }]; - let window_bind_group_layout = Pipeline::build_bind_group_layout(&device, &window_binding_types); + // let window_binding_types = vec![wgpu::BindingType::UniformBuffer { dynamic: false }]; + // let window_bind_group_layout = Pipeline::build_bind_group_layout(&device, &window_binding_types); // Data structure maintaining the user interface // let extra_layouts = vec![&window_bind_group_layout]; @@ -112,7 +112,7 @@ impl Application { // Handle custom-dispatched events Event::UserEvent(_) => (), // Called once every event is handled and the GUI structure is updated - Event::MainEventsCleared => self.update_gui(window), + Event::MainEventsCleared => self.update_gui(), // Resizing or calling `window.request_redraw()` renders the GUI with the queued draw commands Event::RedrawRequested(_) => self.render(), // Once all windows have been redrawn @@ -125,7 +125,7 @@ impl Application { } } - pub fn update_gui(&mut self, window: &Window) { + pub fn update_gui(&mut self) { } diff --git a/src/bind_group_resource.rs b/src/bind_group_resource.rs deleted file mode 100644 index d134611e..00000000 --- a/src/bind_group_resource.rs +++ /dev/null @@ -1,13 +0,0 @@ -pub enum BindGroupResource<'a> { - Owned(wgpu::BindGroup), - Borrowed(&'a wgpu::BindGroup), -} - -impl<'a> BindGroupResource<'a> { - pub fn borrow(&self) -> BindGroupResource { - match self { - BindGroupResource::Owned(ref bind_group) => BindGroupResource::Borrowed(bind_group), - BindGroupResource::Borrowed(ref bind_group) => BindGroupResource::Borrowed(bind_group), - } - } -} \ No newline at end of file diff --git a/src/color.rs b/src/color.rs index 55bef396..449f8ced 100644 --- a/src/color.rs +++ b/src/color.rs @@ -12,6 +12,7 @@ impl Color { Self { r, g, b, a } } + #[allow(dead_code)] pub const TRANSPARENT: Self = Color { r: 0.0, g: 0.0, @@ -19,6 +20,7 @@ impl Color { a: 0.0, }; + #[allow(dead_code)] pub const BLACK: Self = Color { r: 0.0, g: 0.0, @@ -26,6 +28,7 @@ impl Color { a: 1.0, }; + #[allow(dead_code)] pub const WHITE: Self = Color { r: 1.0, g: 1.0, @@ -33,6 +36,7 @@ impl Color { a: 1.0, }; + #[allow(dead_code)] pub const RED: Self = Color { r: 1.0, g: 0.0, @@ -40,6 +44,7 @@ impl Color { a: 1.0, }; + #[allow(dead_code)] pub const YELLOW: Self = Color { r: 1.0, g: 1.0, @@ -47,6 +52,7 @@ impl Color { a: 1.0, }; + #[allow(dead_code)] pub const GREEN: Self = Color { r: 0.0, g: 1.0, @@ -54,6 +60,7 @@ impl Color { a: 1.0, }; + #[allow(dead_code)] pub const CYAN: Self = Color { r: 0.0, g: 1.0, @@ -61,6 +68,7 @@ impl Color { a: 1.0, }; + #[allow(dead_code)] pub const BLUE: Self = Color { r: 0.0, g: 0.0, @@ -68,6 +76,7 @@ impl Color { a: 1.0, }; + #[allow(dead_code)] pub const MAGENTA: Self = Color { r: 1.0, g: 0.0, diff --git a/src/color_palette.rs b/src/color_palette.rs index 1462bdd8..a771c1db 100644 --- a/src/color_palette.rs +++ b/src/color_palette.rs @@ -22,6 +22,7 @@ pub enum ColorPalette { } impl ColorPalette { + #[allow(dead_code)] pub fn get_color_srgb(self) -> Color { let grayscale = match self { ColorPalette::Black => 0 * 17, // #000000 @@ -56,6 +57,7 @@ impl ColorPalette { Color::new(rgba.0 as f32 / 255.0, rgba.1 as f32 / 255.0, rgba.2 as f32 / 255.0, rgba.3 as f32 / 255.0) } + #[allow(dead_code)] pub fn get_color_linear(self) -> Color { let standard_rgb = ColorPalette::get_color_srgb(self); diff --git a/src/gui_node.rs b/src/gui_node.rs index df61ca46..9c77556e 100644 --- a/src/gui_node.rs +++ b/src/gui_node.rs @@ -41,7 +41,7 @@ impl GuiNode { let texture = Texture::cached_load(device, queue, "textures/grid.png", texture_cache); // Build a staging buffer from the uniform resource data - let binding_staging_buffer = Pipeline::build_binding_staging_buffer(device, self.form_factor); + let binding_staging_buffer = Pipeline::build_binding_staging_buffer(device, &self.form_factor); // Construct the bind group for this GUI node let bind_group = Pipeline::build_bind_group(device, &pipeline.bind_group_layout, vec![ diff --git a/src/main.rs b/src/main.rs index e9f80d4c..1b717619 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,7 +10,6 @@ mod gui_node; mod gui_attributes; mod window_events; mod window_uniform; -mod bind_group_resource; use application::Application; use winit::event_loop::EventLoop; diff --git a/src/pipeline.rs b/src/pipeline.rs index 57686979..5d5599fe 100644 --- a/src/pipeline.rs +++ b/src/pipeline.rs @@ -71,10 +71,10 @@ impl Pipeline { }) } - pub fn build_binding_staging_buffer(device: &wgpu::Device, resource: T) -> wgpu::Buffer { // TODO: Turn this into a borrow + pub fn build_binding_staging_buffer(device: &wgpu::Device, resource: &T) -> wgpu::Buffer { // Construct a staging buffer with the binary uniform struct data device.create_buffer_with_data( - bytemuck::cast_slice(&[resource]), + bytemuck::cast_slice(&[*resource]), wgpu::BufferUsage::UNIFORM | wgpu::BufferUsage::COPY_DST, ) }