use super::Operations; use crate::{renderer::TextureId, Color}; #[derive(Debug, Clone)] pub enum TextureAttachment { Id(TextureId), Name(String), Input(String), } impl TextureAttachment { pub fn get_texture_id(&self) -> Option { if let TextureAttachment::Id(texture_id) = self { Some(*texture_id) } else { None } } } #[derive(Clone, Debug)] pub struct ClearColor(pub Color); impl Default for ClearColor { fn default() -> Self { Self(Color::rgb(0.1, 0.1, 0.1)) } } #[derive(Debug, Clone)] pub struct RenderPassColorAttachmentDescriptor { /// The actual color attachment. pub attachment: TextureAttachment, /// The resolve target for this color attachment, if any. pub resolve_target: Option, /// What operations will be performed on this color attachment. pub ops: Operations, } #[derive(Debug, Clone)] pub struct RenderPassDepthStencilAttachmentDescriptor { pub attachment: TextureAttachment, /// What operations will be performed on the depth part of the attachment. pub depth_ops: Option>, /// What operations will be performed on the stencil part of the attachment. pub stencil_ops: Option>, } // A set of pipeline bindings and draw calls with color and depth outputs #[derive(Debug, Clone)] pub struct PassDescriptor { pub color_attachments: Vec, pub depth_stencil_attachment: Option, pub sample_count: u32, }