aboutsummaryrefslogtreecommitdiff
path: root/stockton-skeleton/src/buffers/image.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/buffers/image.rs
parent5e6396ed225be9a9991705de10174b3cf085f8f0 (diff)
WIP refactor(skeleton): type state for context
also some api improvements closes #2 related: #7
Diffstat (limited to 'stockton-skeleton/src/buffers/image.rs')
-rw-r--r--stockton-skeleton/src/buffers/image.rs16
1 files changed, 4 insertions, 12 deletions
diff --git a/stockton-skeleton/src/buffers/image.rs b/stockton-skeleton/src/buffers/image.rs
index 4278585..820561f 100644
--- a/stockton-skeleton/src/buffers/image.rs
+++ b/stockton-skeleton/src/buffers/image.rs
@@ -73,7 +73,7 @@ impl<P: MemoryPool> BoundImageView<P> {
.write()
.map_err(|_| LockPoisoned::MemoryPool)?;
- let mut device = context.device().write().map_err(|_| LockPoisoned::Device)?;
+ let mut device = context.lock_device()?;
let row_alignment_mask = context
.physical_device_properties()
.limits
@@ -149,11 +149,7 @@ impl<P: MemoryPool> BoundImageView<P> {
/// Destroy all vulkan objects. Must be called before dropping.
pub fn deactivate_with_context(self, context: &mut RenderingContext) {
- let mut device = context
- .device()
- .write()
- .map_err(|_| LockPoisoned::Device)
- .unwrap();
+ let mut device = context.lock_device().unwrap();
let mut pool = context
.existing_memory_pool::<P>()
.unwrap()
@@ -227,7 +223,7 @@ impl<P: MemoryPool> SampledImage<P> {
.write()
.map_err(|_| LockPoisoned::MemoryPool)?;
- let mut device = context.device().write().map_err(|_| LockPoisoned::Device)?;
+ let mut device = context.lock_device()?;
let row_alignment_mask = context
.physical_device_properties()
.limits
@@ -267,11 +263,7 @@ impl<P: MemoryPool> SampledImage<P> {
/// Destroy all vulkan objects. Must be called before dropping.
pub fn deactivate_with_context(self, context: &mut RenderingContext) {
- let mut device = context
- .device()
- .write()
- .map_err(|_| LockPoisoned::Device)
- .unwrap();
+ let mut device = context.lock_device().unwrap();
let mut pool = context
.existing_memory_pool::<P>()
.unwrap()