The submit module now uses UnsyncedCommandBuffer

This commit is contained in:
Pierre Krieger 2016-11-13 20:04:43 +01:00
parent 2971b867be
commit 211039c0ae
3 changed files with 15 additions and 4 deletions

View File

@ -231,6 +231,17 @@ impl<L, P> UnsyncedCommandBuffer<L, P> where L: CommandsList, P: CommandPool {
}
}
unsafe impl<L, P> VulkanObject for UnsyncedCommandBuffer<L, P>
where P: CommandPool
{
type Object = vk::CommandBuffer;
#[inline]
fn internal_object(&self) -> vk::CommandBuffer {
self.cmd
}
}
// Helper object for UnsyncedCommandBuffer. Implementation detail.
struct Sink<'a>(&'a mut RawCommandBufferPrototype<'a>, &'a Arc<Device>);
impl<'a> CommandsListSink<'a> for Sink<'a> {

View File

@ -62,11 +62,11 @@ use sync::Semaphore;
use vk;
pub mod cb;
pub mod cmd;
pub mod pool;
pub mod sys;
mod cb;
mod submit;
#[repr(C)]

View File

@ -15,8 +15,8 @@ use std::sync::Arc;
use std::time::Duration;
use smallvec::SmallVec;
use command_buffer::cb::UnsyncedCommandBuffer;
use command_buffer::pool::CommandPool;
use command_buffer::sys::UnsafeCommandBuffer;
use device::Device;
use device::Queue;
use sync::Fence;
@ -262,8 +262,8 @@ impl<'a> SubmitBuilder<'a> {
/// that builds this `SubmitBuilder`. Consequently keeping the `Submit` object alive is enough
/// to guarantee that the command buffer is kept alive as well.
#[inline]
pub fn add_command_buffer<P>(self, command_buffer: &'a UnsafeCommandBuffer<P>)
-> SubmitBuilder<'a>
pub fn add_command_buffer<L, P>(self, command_buffer: &'a UnsyncedCommandBuffer<L, P>)
-> SubmitBuilder<'a>
where P: CommandPool
{
self.add_command_buffer_raw(command_buffer.internal_object())