screen_13/graph/
swapchain.rs1use {
2 super::{Bind, Binding, RenderGraph, SwapchainImageNode},
3 crate::driver::swapchain::SwapchainImage,
4};
5
6impl Bind<&mut RenderGraph, SwapchainImageNode> for SwapchainImage {
7 fn bind(self, graph: &mut RenderGraph) -> SwapchainImageNode {
8 let res = SwapchainImageNode::new(graph.bindings.len());
10
11 let binding = Binding::SwapchainImage(Box::new(self), true);
14 graph.bindings.push(binding);
15
16 res
17 }
18}
19
20impl Binding {
21 pub(super) fn as_swapchain_image(&self) -> Option<&SwapchainImage> {
22 if let Self::SwapchainImage(binding, true) = self {
23 Some(binding)
24 } else if let Self::SwapchainImage(_, false) = self {
25 None
28 } else {
29 unreachable!();
31 }
32 }
33}