Secondary graphics cmd buffers now require passing a renderpass

This commit is contained in:
Pierre Krieger 2016-02-27 14:09:45 +01:00
parent 2a6252efbe
commit ef9b3fed9a

View File

@ -14,6 +14,7 @@ use format::StrongStorage;
use framebuffer::Framebuffer; use framebuffer::Framebuffer;
use framebuffer::RenderPass; use framebuffer::RenderPass;
use framebuffer::RenderPassLayout; use framebuffer::RenderPassLayout;
use framebuffer::Subpass;
use image::Image; use image::Image;
use image::ImageTypeMarker; use image::ImageTypeMarker;
use memory::MemorySourceChunk; use memory::MemorySourceChunk;
@ -443,18 +444,27 @@ impl PrimaryCommandBuffer {
} }
/// A prototype of a secondary compute command buffer. /// A prototype of a secondary compute command buffer.
pub struct SecondaryGraphicsCommandBufferBuilder { pub struct SecondaryGraphicsCommandBufferBuilder<R> {
inner: InnerCommandBufferBuilder, inner: InnerCommandBufferBuilder,
renderpass_layout: R,
renderpass_subpass: u32,
} }
impl SecondaryGraphicsCommandBufferBuilder { impl<R> SecondaryGraphicsCommandBufferBuilder<R>
where R: RenderPassLayout
{
/// Builds a new secondary command buffer and start recording commands in it. /// Builds a new secondary command buffer and start recording commands in it.
#[inline] #[inline]
pub fn new(pool: &Arc<CommandBufferPool>) pub fn new(pool: &Arc<CommandBufferPool>, subpass: Subpass<R>)
-> Result<SecondaryGraphicsCommandBufferBuilder, OomError> -> Result<SecondaryGraphicsCommandBufferBuilder<R>, OomError>
where R: Clone
{ {
let inner = try!(InnerCommandBufferBuilder::new(pool, true)); let inner = try!(InnerCommandBufferBuilder::new(pool, true));
Ok(SecondaryGraphicsCommandBufferBuilder { inner: inner }) Ok(SecondaryGraphicsCommandBufferBuilder {
inner: inner,
renderpass_layout: subpass.renderpass().layout().clone(),
renderpass_subpass: subpass.index(),
})
} }
/// Finish recording commands and build the command buffer. /// Finish recording commands and build the command buffer.