Handle situation where no attachment is loaded with Clear

This commit is contained in:
Pierre Krieger 2016-03-28 18:08:43 +02:00
parent 46ce11e1b1
commit 1b1f489b80

View File

@ -585,11 +585,11 @@ macro_rules! ordered_passes_renderpass {
ordered_passes_renderpass!{__impl_clear_values__ [$num+1] [$($s)*] [$($rest)*] }
};
(__impl_clear_values__ [$total:expr] [$($atch:ident [$num:expr] $format:ident,)*] []) => {
(__impl_clear_values__ [$total:expr] [$($atch:ident [$num:expr] $format:ident,)+] []) => {
pub struct ClearValues {
$(
pub $atch: <$crate::format::$format as $crate::format::FormatDesc>::ClearValue,
)*
)+
}
pub struct ClearValuesIter(ClearValues, usize);
@ -622,6 +622,22 @@ macro_rules! ordered_passes_renderpass {
impl ExactSizeIterator for ClearValuesIter {}
};
(__impl_clear_values__ [$total:expr] [] []) => {
pub type ClearValues = ();
pub struct ClearValuesIter((), usize);
impl Iterator for ClearValuesIter {
type Item = $crate::format::ClearValue;
#[inline]
fn next(&mut self) -> Option<Self::Item> { None }
#[inline]
fn size_hint(&self) -> (usize, Option<usize>) { (0, Some(0)) }
}
impl ExactSizeIterator for ClearValuesIter {}
};
}
/// Describes what the implementation should do with an attachment after all the subpasses have