Now panicking if not all subpasses have been used

This commit is contained in:
Pierre Krieger 2016-03-06 20:01:56 +01:00
parent a5c3a8e32f
commit 6b06fdd693

View File

@ -320,16 +320,17 @@ impl PrimaryCommandBufferBuilderInlineDraw {
} }
/// Finish drawing this renderpass and get back the builder. /// Finish drawing this renderpass and get back the builder.
///
/// # Panic
///
/// - Panicks if not at the last subpass.
///
#[inline] #[inline]
pub fn draw_end(mut self) -> PrimaryCommandBufferBuilder { pub fn draw_end(mut self) -> PrimaryCommandBufferBuilder {
assert!(self.current_subpass + 1 == self.num_subpasses);
unsafe { unsafe {
// skipping the remaining subpasses
for _ in 0 .. (self.num_subpasses - self.current_subpass - 1) {
self.inner = self.inner.next_subpass(false);
}
let inner = self.inner.end_renderpass(); let inner = self.inner.end_renderpass();
PrimaryCommandBufferBuilder { PrimaryCommandBufferBuilder {
inner: inner, inner: inner,
} }
@ -410,16 +411,17 @@ impl PrimaryCommandBufferBuilderSecondaryDraw {
} }
/// Finish drawing this renderpass and get back the builder. /// Finish drawing this renderpass and get back the builder.
///
/// # Panic
///
/// - Panicks if not at the last subpass.
///
#[inline] #[inline]
pub fn draw_end(mut self) -> PrimaryCommandBufferBuilder { pub fn draw_end(mut self) -> PrimaryCommandBufferBuilder {
assert!(self.current_subpass + 1 == self.num_subpasses);
unsafe { unsafe {
// skipping the remaining subpasses
for _ in 0 .. (self.num_subpasses - self.current_subpass - 1) {
self.inner = self.inner.next_subpass(false);
}
let inner = self.inner.end_renderpass(); let inner = self.inner.end_renderpass();
PrimaryCommandBufferBuilder { PrimaryCommandBufferBuilder {
inner: inner, inner: inner,
} }