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
commit4f068467c4954fb79e6ce297ae1ac0fdd2bdf16a (patch)
tree4b3ec44d068f71ab80e8c85a6515a8862407ac56 /stockton-skeleton/src/texture/loader.rs
parent5e6396ed225be9a9991705de10174b3cf085f8f0 (diff)
WIP refactor(skeleton): type state for context
also some api improvements closes #2 related: #7
Diffstat (limited to 'stockton-skeleton/src/texture/loader.rs')
-rw-r--r--stockton-skeleton/src/texture/loader.rs16
1 files changed, 5 insertions, 11 deletions
diff --git a/stockton-skeleton/src/texture/loader.rs b/stockton-skeleton/src/texture/loader.rs
index 80d4a61..6de4a4d 100644
--- a/stockton-skeleton/src/texture/loader.rs
+++ b/stockton-skeleton/src/texture/loader.rs
@@ -12,7 +12,7 @@ use super::{
use crate::{
buffers::image::SampledImage,
context::RenderingContext,
- error::{EnvironmentError, LockPoisoned},
+ error::LockPoisoned,
mem::{MappableBlock, MemoryPool},
queue_negotiator::QueueFamilySelector,
types::*,
@@ -216,22 +216,16 @@ where
config: TextureLoadConfig<R>,
) -> Result<Self> {
// Queue family & Lock
- let family = context
- .queue_negotiator_mut()
- .family::<Q>()
- .ok_or(EnvironmentError::NoSuitableFamilies)?;
- let queue_lock = context.queue_negotiator_mut().get_queue::<Q>()?;
+ let family = context.get_queue_family::<Q>()?;
+ let queue_lock = context.get_queue::<Q>()?;
// Memory pools
let tex_mempool = context.memory_pool()?.clone();
let staging_mempool = context.memory_pool()?.clone();
// Lock device
- let device_lock = context.device().clone();
- let mut device = device_lock
- .write()
- .map_err(|_| LockPoisoned::Device)
- .context("Error getting device lock")?;
+ let device_lock = context.clone_device_lock();
+ let mut device = context.lock_device().context("Error getting device lock")?;
// Physical properties
let device_props = context.physical_device_properties();