mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-22 23:05:43 +00:00
Remove old CommandBuffer struct
This commit is contained in:
parent
9d3652f229
commit
3502023436
@ -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)
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user