From fb996488aa651cb2e7f46abc083c4318b47e77cd Mon Sep 17 00:00:00 2001 From: tcmal Date: Sun, 25 Aug 2024 17:44:23 +0100 Subject: wip refactor(render): more work on draw passes --- stockton-render/src/draw/draw_passes/cons.rs | 34 ++++++++-------------------- 1 file changed, 10 insertions(+), 24 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 274bd76..76e2f32 100644 --- a/stockton-render/src/draw/draw_passes/cons.rs +++ b/stockton-render/src/draw/draw_passes/cons.rs @@ -1,22 +1,22 @@ //! 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 super::{DrawPass, DrawPassInput}; +use super::DrawPass; use crate::{draw::queue_negotiator::QueueNegotiator, types::*}; +use stockton_types::Session; + use anyhow::Result; /// One draw pass, then another. -struct ConsDrawPass { +pub struct ConsDrawPass { a: A, b: B, } impl DrawPass for ConsDrawPass { - type Input = ConsDrawPassInput; - - fn queue_draw(&self, input: &Self::Input, cmd_buffer: &mut CommandBufferT) -> Result<()> { - self.a.queue_draw(&input.a, cmd_buffer)?; - self.b.queue_draw(&input.b, cmd_buffer)?; + 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)?; Ok(()) } @@ -34,21 +34,12 @@ impl DrawPass for ConsDrawPass { } } -/// Input for a ConsDrawPass. -struct ConsDrawPassInput { - pub a: A, - pub b: B, -} - -impl DrawPassInput for ConsDrawPassInput {} - /// A draw pass that does nothing. Can be used at the end of sequences if there's an odd number of draw passes. -struct NilDrawPass; +pub struct NilDrawPass; impl DrawPass for NilDrawPass { - type Input = NilDrawPassInput; - fn queue_draw(&self, _input: &Self::Input, _cmd_buffer: &mut CommandBufferT) -> Result<()> { + fn queue_draw(&self, _input: &Session, _cmd_buffer: &mut CommandBufferT) -> Result<()> { Ok(()) } @@ -58,9 +49,4 @@ impl DrawPass for NilDrawPass { ) -> Result)>> { Ok(vec![]) } -} - -/// Input for a NilDrawPass. -struct NilDrawPassInput; - -impl DrawPassInput for NilDrawPassInput {} +} \ No newline at end of file -- cgit v1.2.3