Merge pull request #653 from tomaka/secondary-cb-fixes

Misc fixes to make secondary command buffers usable
This commit is contained in:
tomaka 2017-07-18 15:04:29 +02:00 committed by GitHub
commit ea7a1d30c0

View File

@ -375,7 +375,7 @@ impl AutoCommandBufferBuilder<StandardCommandPoolBuilder> {
compute_allowed,
subpasses_remaining,
secondary_cb,
subpass_secondary: secondary_cb,
subpass_secondary: false,
flags,
})
}
@ -412,12 +412,10 @@ impl<P> AutoCommandBufferBuilder<P> {
pub fn build(self) -> Result<AutoCommandBuffer<P::Alloc>, BuildError>
where P: CommandPoolBuilderAlloc
{
if self.secondary_cb {
return Err(AutoCommandBufferBuilderContextError::ForbiddenInSecondary.into());
if !self.secondary_cb && self.subpasses_remaining.is_some() {
return Err(AutoCommandBufferBuilderContextError::ForbiddenInsideRenderPass.into());
}
self.ensure_outside_render_pass()?;
let submit_state = match self.flags {
Flags::None => {
SubmitState::ExclusiveUse { in_use: AtomicBool::new(false) }