From 47a0c0317cc774c19b78582bec9b5b09d56f569a Mon Sep 17 00:00:00 2001 From: tcmal Date: Sun, 25 Aug 2024 17:44:23 +0100 Subject: feat(render): draw passes --- stockton-render/src/draw/draw_passes/cons.rs | 45 ++++++++++++++-------------- 1 file changed, 23 insertions(+), 22 deletions(-) (limited to 'stockton-render/src/draw/draw_passes/cons.rs') diff --git a/stockton-render/src/draw/draw_passes/cons.rs b/stockton-render/src/draw/draw_passes/cons.rs index 76e2f32..8f912ec 100644 --- a/stockton-render/src/draw/draw_passes/cons.rs +++ b/stockton-render/src/draw/draw_passes/cons.rs @@ -1,8 +1,10 @@ //! Code for using multiple draw passes in place of just one //! Note that this can be extended to an arbitrary amount of draw passes. +use std::sync::{Arc, RwLock}; + use super::DrawPass; -use crate::{draw::queue_negotiator::QueueNegotiator, types::*}; +use crate::types::*; use stockton_types::Session; use anyhow::Result; @@ -14,23 +16,21 @@ pub struct ConsDrawPass { } impl DrawPass for ConsDrawPass { - fn queue_draw(&self, session: &Session, cmd_buffer: &mut CommandBufferT) -> Result<()> { - self.a.queue_draw(&session, cmd_buffer)?; - self.b.queue_draw(&session, cmd_buffer)?; + fn queue_draw( + &mut self, + session: &Session, + img_view: &ImageViewT, + cmd_buffer: &mut CommandBufferT, + ) -> Result<()> { + self.a.queue_draw(session, img_view, cmd_buffer)?; + self.b.queue_draw(session, img_view, cmd_buffer)?; Ok(()) } - fn find_aux_queues<'a>( - adapter: &'a Adapter, - queue_negotiator: &mut QueueNegotiator, - ) -> Result)>> { - let mut vec = Vec::new(); - - vec.extend(A::find_aux_queues(adapter, queue_negotiator)?); - vec.extend(B::find_aux_queues(adapter, queue_negotiator)?); - - Ok(vec) + fn deactivate(self, device: &mut Arc>) -> Result<()> { + self.a.deactivate(device)?; + self.b.deactivate(device) } } @@ -38,15 +38,16 @@ impl DrawPass for ConsDrawPass { pub struct NilDrawPass; impl DrawPass for NilDrawPass { - - fn queue_draw(&self, _input: &Session, _cmd_buffer: &mut CommandBufferT) -> Result<()> { + fn queue_draw( + &mut self, + _input: &Session, + _img_view: &ImageViewT, + _cmd_buffer: &mut CommandBufferT, + ) -> Result<()> { Ok(()) } - fn find_aux_queues<'a>( - _adapter: &'a Adapter, - _queue_negotiator: &mut QueueNegotiator, - ) -> Result)>> { - Ok(vec![]) + fn deactivate(self, _device: &mut Arc>) -> Result<()> { + Ok(()) } -} \ No newline at end of file +} -- cgit v1.2.3