diff options
Diffstat (limited to 'stockton-render/src/draw/draw_passes/mod.rs')
-rw-r--r-- | stockton-render/src/draw/draw_passes/mod.rs | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/stockton-render/src/draw/draw_passes/mod.rs b/stockton-render/src/draw/draw_passes/mod.rs index 566a64b..70f1786 100644 --- a/stockton-render/src/draw/draw_passes/mod.rs +++ b/stockton-render/src/draw/draw_passes/mod.rs @@ -10,22 +10,21 @@ use anyhow::Result; mod cons; mod level; -pub use level::LevelDrawPass; pub use cons::{ConsDrawPass, NilDrawPass}; +pub use level::LevelDrawPass; /// One of several 'passes' that draw on each frame. pub trait DrawPass { /// Queue any necessary draw commands to cmd_buffer /// This should assume the command buffer isn't in the middle of a renderpass, and should leave it as such. - fn queue_draw(&self, session: &Session, cmd_buffer: &mut CommandBufferT) -> Result<()>; + fn queue_draw( + &mut self, + session: &Session, + img_view: &ImageViewT, + cmd_buffer: &mut CommandBufferT, + ) -> Result<()>; - /// This function should ask the queue negotatior to find families for any auxilary operations this draw pass needs to perform - /// For example, .find(&TexLoadQueue) - /// It should return then call .family_spec for each queue type negotiated and return the results. - fn find_aux_queues<'a>( - adapter: &'a Adapter, - queue_negotiator: &mut QueueNegotiator, - ) -> Result<Vec<(&'a QueueFamilyT, Vec<f32>)>>; + fn deactivate(self, device: &mut Arc<RwLock<DeviceT>>) -> Result<()>; } /// A type that can be made into a specific draw pass type. @@ -33,8 +32,18 @@ pub trait DrawPass { pub trait IntoDrawPass<O: DrawPass> { fn init( self, + session: &Session, + adapter: &Adapter, device: Arc<RwLock<DeviceT>>, queue_negotiator: &mut QueueNegotiator, swapchain_properties: &SwapchainProperties, ) -> Result<O>; + + /// This function should ask the queue negotatior to find families for any auxilary operations this draw pass needs to perform + /// For example, .find(&TexLoadQueue) + /// It should return then call .family_spec for each queue type negotiated and return the results. + fn find_aux_queues<'a>( + adapter: &'a Adapter, + queue_negotiator: &mut QueueNegotiator, + ) -> Result<Vec<(&'a QueueFamilyT, Vec<f32>)>>; } |