diff options
author | tcmal <me@aria.rip> | 2024-08-25 17:44:24 +0100 |
---|---|---|
committer | tcmal <me@aria.rip> | 2024-08-25 17:44:24 +0100 |
commit | 4f068467c4954fb79e6ce297ae1ac0fdd2bdf16a (patch) | |
tree | 4b3ec44d068f71ab80e8c85a6515a8862407ac56 /stockton-render/src/ui.rs | |
parent | 5e6396ed225be9a9991705de10174b3cf085f8f0 (diff) |
WIP refactor(skeleton): type state for context
also some api improvements
closes #2
related: #7
Diffstat (limited to 'stockton-render/src/ui.rs')
-rw-r--r-- | stockton-render/src/ui.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/stockton-render/src/ui.rs b/stockton-render/src/ui.rs index f688f42..474c1dd 100644 --- a/stockton-render/src/ui.rs +++ b/stockton-render/src/ui.rs @@ -9,7 +9,6 @@ use stockton_skeleton::{ }, context::RenderingContext, draw_passes::{util::TargetSpecificResources, DrawPass, IntoDrawPass, PassPosition}, - error::LockPoisoned, mem::{DataPool, StagingPool, TexturesPool}, queue_negotiator::QueueFamilyNegotiator, texture::{ @@ -201,7 +200,7 @@ impl<'a, P: PassPosition> DrawPass<P> for UiDrawPass<'a> { self.draw_buffers.deactivate(context); unsafe { - let mut device = context.device().write().map_err(|_| LockPoisoned::Device)?; + let mut device = context.lock_device()?; self.pipeline.deactivate(&mut device); for fb in self.framebuffers.dissolve() { device.destroy_framebuffer(fb); @@ -307,7 +306,7 @@ impl<'a, P: PassPosition> IntoDrawPass<UiDrawPass<'a>, P> for () { DrawBuffers::from_context(context).context("Error creating draw buffers")?; let (pipeline, framebuffers) = { - let mut device = context.device().write().map_err(|_| LockPoisoned::Device)?; + let mut device = context.lock_device()?; let pipeline = spec .build( @@ -339,8 +338,8 @@ impl<'a, P: PassPosition> IntoDrawPass<UiDrawPass<'a>, P> for () { }) } - fn find_aux_queues<'c>( - adapter: &'c Adapter, + fn find_aux_queues( + adapter: &Adapter, queue_negotiator: &mut QueueFamilyNegotiator, ) -> Result<()> { queue_negotiator.find(adapter, &TexLoadQueue, 1)?; |