Skip to content

Commit

Permalink
Fix warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
de-vri-es committed Mar 30, 2024
1 parent e638744 commit d6f1008
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/backend/util/gpu_image.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::ImageInfo;
use crate::ImageView;
use crate::{Alpha, PixelFormat};
use super::buffer::create_buffer_with_value;
use super::create_buffer_with_value;

/// A GPU image buffer ready to be used with the rendering pipeline.
pub struct GpuImage {
Expand Down
9 changes: 0 additions & 9 deletions src/backend/util/map_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,3 @@ pub fn map_buffer<'a>(device: &wgpu::Device, buffer: wgpu::BufferSlice<'a>) -> R
wait_for_buffer(device, buffer, wgpu::MapMode::Read)?;
Ok(buffer.get_mapped_range())
}

/// Synchronously map a buffer for write access.
///
/// This will internally call [`wgpu::Device::poll()`] until the buffer is ready, and then map it.
#[allow(unused)]
pub fn map_buffer_mut<'a>(device: &wgpu::Device, buffer: wgpu::BufferSlice<'a>) -> Result<wgpu::BufferViewMut<'a>, wgpu::BufferAsyncError> {
wait_for_buffer(device, buffer, wgpu::MapMode::Write)?;
Ok(buffer.get_mapped_range_mut())
}
3 changes: 2 additions & 1 deletion src/backend/util/mod.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
mod buffer;
mod gpu_image;
#[cfg(feature = "save")]
mod map_buffer;
mod retain_mut;
mod uniforms_buffer;

pub use buffer::create_buffer_with_value;
pub use gpu_image::GpuImage;
pub use gpu_image::GpuImageUniforms;
#[cfg(feature = "save")]
pub use map_buffer::map_buffer;
pub use map_buffer::map_buffer_mut;
pub use retain_mut::RetainMut;
pub use uniforms_buffer::{ToStd140, UniformsBuffer};
2 changes: 1 addition & 1 deletion src/features/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ where
P: image::Pixel<Subpixel = u8> + image::PixelWithColorType,
Container: Deref<Target = [u8]>,
{
&*buffer
buffer
}

fn dynamic_image_as_bytes(image: &image::DynamicImage) -> &[u8] {
Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,16 @@ mod background_thread;
pub mod error;
pub mod event;
mod features;
mod image;
mod image_info;
mod image_types;
mod oneshot;
mod rectangle;

pub use self::backend::*;
#[allow(unused_imports)]
pub use self::features::*;
pub use self::image::*;
pub use self::image_info::*;
pub use self::image_types::*;
pub use self::rectangle::Rectangle;

pub use winit;
Expand Down

0 comments on commit d6f1008

Please sign in to comment.