Remove old CommandBuffer struct

This commit is contained in:
Pierre Krieger 2016-11-10 14:38:06 +01:00
parent 9d3652f229
commit 3502023436
2 changed files with 0 additions and 69 deletions

View File

@ -321,71 +321,3 @@ pub unsafe trait CommandsListPossibleInsideRenderPass {
//fn current_subpass(&self) -> Subpass<&Self::RenderPass>;
}
#[deprecated]
pub unsafe trait CommandsListOutput<S = StatesManager> {
/// Returns the inner object.
// TODO: crappy API
#[deprecated]
fn inner(&self) -> vk::CommandBuffer;
/// Returns the device this object belongs to.
#[deprecated]
fn device(&self) -> &Arc<Device>;
#[deprecated]
unsafe fn on_submit(&self, states: &S, queue: &Arc<Queue>,
fence: &mut FnMut() -> Arc<Fence>) -> SubmitInfo;
}
#[deprecated]
pub struct CommandBuffer<C = Box<CommandsListOutput>> {
states: StatesManager,
commands: C,
}
unsafe impl<C> Submit for CommandBuffer<C> where C: CommandsListOutput {
#[inline]
fn device(&self) -> &Arc<Device> {
self.commands.device()
}
#[inline]
unsafe fn append_submission<'a>(&'a self, mut base: SubmitBuilder<'a>, queue: &Arc<Queue>)
-> Result<SubmitBuilder<'a>, Box<Error>>
{
let mut fence = None;
let infos = self.commands.on_submit(&self.states, queue, &mut || {
match &mut fence {
f @ &mut None => {
let fe = Fence::new(self.device().clone()); *f = Some(fe.clone()); fe
},
&mut Some(ref f) => f.clone()
}
});
for (sem_wait, sem_stage) in infos.semaphores_wait {
base = base.add_wait_semaphore(sem_wait, sem_stage);
}
if !infos.pre_pipeline_barrier.is_empty() {
unimplemented!()
}
base = base.add_command_buffer_raw(self.commands.inner());
if !infos.post_pipeline_barrier.is_empty() {
unimplemented!()
}
for sem_signal in infos.semaphores_signal {
base = base.add_signal_semaphore(sem_signal);
}
if let Some(fence) = fence {
base = base.add_fence_signal(fence);
}
Ok(base)
}
}

View File

@ -43,7 +43,6 @@
pub use self::states_manager::StatesManager;
pub use self::cmd::empty;
pub use self::cmd::CommandBuffer;
pub use self::cmd::CommandsList;
pub use self::cmd::CommandsListSink;
pub use self::cmd::CommandsListSinkCaller;