aboutsummaryrefslogtreecommitdiff
path: root/stockton-skeleton/src/texture/loader.rs
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-08-25 17:44:24 +0100
committertcmal <me@aria.rip>2024-08-25 17:44:24 +0100
commit5360fe6a337145b2640ec1e5727c97fd9bbeacd9 (patch)
tree264f4cda45b001fb5049b9120d4d7b3a63c95e6f /stockton-skeleton/src/texture/loader.rs
parent0ddc1e39dc24cff636defbbbab974967bb5301b8 (diff)
refactor(all): small fixes
Diffstat (limited to 'stockton-skeleton/src/texture/loader.rs')
-rw-r--r--stockton-skeleton/src/texture/loader.rs16
1 files changed, 11 insertions, 5 deletions
diff --git a/stockton-skeleton/src/texture/loader.rs b/stockton-skeleton/src/texture/loader.rs
index ea42c29..80d4a61 100644
--- a/stockton-skeleton/src/texture/loader.rs
+++ b/stockton-skeleton/src/texture/loader.rs
@@ -149,7 +149,11 @@ where
.context("Error checking fence status")?;
if signalled {
- let (assets, mut staging_bufs, block) = self.commands_queued.remove(i).dissolve();
+ let queued_load = self.commands_queued.remove(i);
+ let assets = (queued_load.fence, queued_load.buf);
+ let block = queued_load.block;
+ let mut staging_bufs = queued_load.staging_bufs;
+
debug!("Load finished for texture block {:?}", block.id);
// Lock staging memory pool
@@ -384,8 +388,8 @@ where
let (staging_buffer, img) = load_image(
&mut device,
- &mut self.staging_mempool,
- &mut self.tex_mempool,
+ &self.staging_mempool,
+ &self.tex_mempool,
self.optimal_buffer_copy_pitch_alignment,
img_data,
&self.config,
@@ -613,8 +617,10 @@ where
if signalled {
// Destroy finished ones
- let (assets, mut staging_bufs, block) =
- self.commands_queued.remove(i).dissolve();
+ let queued_load = self.commands_queued.remove(i);
+ let assets = (queued_load.fence, queued_load.buf);
+ let block = queued_load.block;
+ let mut staging_bufs = queued_load.staging_bufs;
device.destroy_fence(assets.0);
// Command buffer will be freed when we reset the command pool