bevy/crates/bevy_render/src/pass/pass.rs

43 lines
1.3 KiB
Rust
Raw Normal View History

2020-03-10 07:53:07 +00:00
use super::{LoadOp, StoreOp};
use crate::{render_resource::RenderResource, Color};
pub enum TextureAttachment {
RenderResource(RenderResource),
Name(String),
Input(String),
}
2020-03-10 07:53:07 +00:00
2020-02-18 02:36:31 +00:00
pub struct RenderPassColorAttachmentDescriptor {
/// The actual color attachment.
pub attachment: TextureAttachment,
2020-02-18 02:36:31 +00:00
/// The resolve target for this color attachment, if any.
pub resolve_target: Option<TextureAttachment>,
2020-02-18 02:36:31 +00:00
/// The beginning-of-pass load operation for this color attachment.
2020-03-10 07:53:07 +00:00
pub load_op: LoadOp,
2020-02-18 02:36:31 +00:00
/// The end-of-pass store operation for this color attachment.
2020-03-10 07:53:07 +00:00
pub store_op: StoreOp,
2020-02-18 02:36:31 +00:00
/// The color that will be assigned to every pixel of this attachment when cleared.
2020-03-10 07:53:07 +00:00
pub clear_color: Color,
2020-02-18 02:36:31 +00:00
}
pub struct RenderPassDepthStencilAttachmentDescriptor {
pub attachment: TextureAttachment,
2020-03-10 07:53:07 +00:00
pub depth_load_op: LoadOp,
pub depth_store_op: StoreOp,
2020-02-18 02:36:31 +00:00
pub clear_depth: f32,
2020-03-10 07:53:07 +00:00
pub stencil_load_op: LoadOp,
pub stencil_store_op: StoreOp,
2020-02-18 02:36:31 +00:00
pub clear_stencil: u32,
}
// A set of pipeline bindings and draw calls with color and depth outputs
pub struct PassDescriptor {
pub color_attachments: Vec<RenderPassColorAttachmentDescriptor>,
pub depth_stencil_attachment: Option<RenderPassDepthStencilAttachmentDescriptor>,
pub sample_count: u32,
2020-01-11 10:11:27 +00:00
}