From 5360fe6a337145b2640ec1e5727c97fd9bbeacd9 Mon Sep 17 00:00:00 2001 From: tcmal Date: Sun, 25 Aug 2024 17:44:24 +0100 Subject: refactor(all): small fixes --- stockton-skeleton/src/buffers/image.rs | 4 ++-- stockton-skeleton/src/buffers/staging.rs | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'stockton-skeleton/src/buffers') diff --git a/stockton-skeleton/src/buffers/image.rs b/stockton-skeleton/src/buffers/image.rs index 34a0a37..4278585 100644 --- a/stockton-skeleton/src/buffers/image.rs +++ b/stockton-skeleton/src/buffers/image.rs @@ -116,7 +116,7 @@ impl BoundImageView

{ // Allocate memory let (mem, _) = pool - .alloc(&device, requirements.size, requirements.alignment) + .alloc(device, requirements.size, requirements.alignment) .context("Error allocating memory")?; // Bind memory @@ -169,7 +169,7 @@ impl BoundImageView

{ unsafe { device.destroy_image_view(read(&*self.img_view)); device.destroy_image(read(&*self.img)); - pool.free(&device, read(&*self.mem)); + pool.free(device, read(&*self.mem)); } } diff --git a/stockton-skeleton/src/buffers/staging.rs b/stockton-skeleton/src/buffers/staging.rs index 5c80f51..44d0c2d 100644 --- a/stockton-skeleton/src/buffers/staging.rs +++ b/stockton-skeleton/src/buffers/staging.rs @@ -61,15 +61,11 @@ where /// Map the given range to CPU-visible memory, returning a pointer to the start of that range. /// inner_range is local to this block of memory, not to the container as a whole. pub fn map(&mut self, device: &mut DeviceT, inner_range: Range) -> Result<*mut u8> { - Ok(<

::Block>::map( - &mut *self.mem, - device, - inner_range, - )?) + <

::Block>::map(&mut *self.mem, device, inner_range) } /// Remove any mappings present for this staging buffer. - pub unsafe fn unmap(&mut self, device: &mut DeviceT) -> Result<()> { + pub fn unmap(&mut self, device: &mut DeviceT) -> Result<()> { self.mem.unmap(device) } -- cgit v1.2.3