From 6ef351de4ba506e7f0f285569aa0e22255bb68c6 Mon Sep 17 00:00:00 2001 From: tcmal Date: Sun, 25 Aug 2024 17:44:23 +0100 Subject: refactor(render): slight leveldrawpass refactors --- stockton-render/src/draw/target.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'stockton-render/src/draw/target.rs') diff --git a/stockton-render/src/draw/target.rs b/stockton-render/src/draw/target.rs index de803aa..3861192 100644 --- a/stockton-render/src/draw/target.rs +++ b/stockton-render/src/draw/target.rs @@ -9,13 +9,16 @@ use std::{ use hal::{ command::CommandBufferFlags, format::{Aspects, ChannelType, Format, ImageFeature}, - image::{Access, Extent, Layout, SubresourceRange, Usage as ImgUsage}, + image::{ + Access, Extent, FramebufferAttachment, Layout, SubresourceRange, Usage as ImgUsage, + ViewCapabilities, + }, memory::{Barrier, Dependencies}, pso::{PipelineStage, Viewport}, window::{CompositeAlphaMode, Extent2D, PresentMode, SwapchainConfig}, }; -use super::{draw_passes::DrawPass}; +use super::draw_passes::DrawPass; use crate::{error::EnvironmentError, types::*}; use anyhow::{Context, Result}; use stockton_types::Session; @@ -107,6 +110,14 @@ impl SwapchainProperties { }, }) } + + pub fn framebuffer_attachment(&self) -> FramebufferAttachment { + FramebufferAttachment { + usage: ImgUsage::COLOR_ATTACHMENT, + format: self.format, + view_caps: ViewCapabilities::empty(), + } + } } pub struct TargetChain { -- cgit v1.2.3