aboutsummaryrefslogtreecommitdiff
path: root/stockton-render/src/draw/draw_passes/cons.rs
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-08-25 17:44:23 +0100
committertcmal <me@aria.rip>2024-08-25 17:44:23 +0100
commit47a0c0317cc774c19b78582bec9b5b09d56f569a (patch)
treed03471ea4e084ace9b95a2c5b7febb780b45bb63 /stockton-render/src/draw/draw_passes/cons.rs
parentfb996488aa651cb2e7f46abc083c4318b47e77cd (diff)
feat(render): draw passes
Diffstat (limited to 'stockton-render/src/draw/draw_passes/cons.rs')
-rw-r--r--stockton-render/src/draw/draw_passes/cons.rs45
1 files changed, 23 insertions, 22 deletions
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<A: DrawPass, B: DrawPass> {
}
impl<A: DrawPass, B: DrawPass> DrawPass for ConsDrawPass<A, B> {
- 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<Vec<(&'a QueueFamilyT, Vec<f32>)>> {
- 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<RwLock<DeviceT>>) -> Result<()> {
+ self.a.deactivate(device)?;
+ self.b.deactivate(device)
}
}
@@ -38,15 +38,16 @@ impl<A: DrawPass, B: DrawPass> DrawPass for ConsDrawPass<A, B> {
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<Vec<(&'a QueueFamilyT, Vec<f32>)>> {
- Ok(vec![])
+ fn deactivate(self, _device: &mut Arc<RwLock<DeviceT>>) -> Result<()> {
+ Ok(())
}
-} \ No newline at end of file
+}