diff options
author | tcmal <me@aria.rip> | 2024-08-25 17:44:23 +0100 |
---|---|---|
committer | tcmal <me@aria.rip> | 2024-08-25 17:44:23 +0100 |
commit | fb996488aa651cb2e7f46abc083c4318b47e77cd (patch) | |
tree | d1513d479b6069abca290e271f439cd1ef553383 /stockton-render/src/draw/target.rs | |
parent | a82e16c92a026b2fbe3a40a21d7e690242e32ba6 (diff) |
wip refactor(render): more work on draw passes
Diffstat (limited to 'stockton-render/src/draw/target.rs')
-rw-r--r-- | stockton-render/src/draw/target.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/stockton-render/src/draw/target.rs b/stockton-render/src/draw/target.rs index 754bad3..c46feb5 100644 --- a/stockton-render/src/draw/target.rs +++ b/stockton-render/src/draw/target.rs @@ -6,15 +6,17 @@ use std::{ }; use hal::{ + command::CommandBufferFlags, format::{ChannelType, Format, ImageFeature}, image::{Extent, Usage as ImgUsage}, pso::Viewport, window::{CompositeAlphaMode, Extent2D, PresentMode, SwapchainConfig}, }; -use super::{depth_buffer::DedicatedLoadedImage, draw_passes::DrawPass}; +use super::{buffers::DedicatedLoadedImage, draw_passes::DrawPass}; use crate::{error::EnvironmentError, types::*}; use anyhow::{Context, Result}; +use stockton_types::Session; #[derive(Debug, Clone)] pub struct SwapchainProperties { @@ -249,7 +251,7 @@ impl TargetChain { device: &mut DeviceT, command_queue: &mut QueueT, dp: &DP, - dpi: &DP::Input, + session: &Session, ) -> Result<()> { self.last_syncs = (self.last_syncs + 1) % self.sync_objects.len(); self.last_image = (self.last_image + 1) % self.targets.len() as u32; @@ -275,9 +277,12 @@ impl TargetChain { }; // Record commands - dp.queue_draw(dpi, &mut target.cmd_buffer) - .context("Error in draw pass")?; unsafe { + target.cmd_buffer.begin_primary(CommandBufferFlags::empty()); + + dp.queue_draw(session, &mut target.cmd_buffer) + .context("Error in draw pass")?; + target.cmd_buffer.finish(); } |