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