Fix bound on blanket RetainResource impl. Clean up run_cmd_buf.
This commit is contained in:
Raph Levien 2021-05-24 15:42:25 -07:00
parent 22935fccc6
commit 174c81ec09
3 changed files with 1 additions and 44 deletions

View file

@ -528,7 +528,7 @@ impl From<Image> for RetainResource {
} }
} }
impl<'a, T: Into<RetainResource>> From<&'a T> for RetainResource { impl<'a, T: Clone + Into<RetainResource>> From<&'a T> for RetainResource {
fn from(resource: &'a T) -> Self { fn from(resource: &'a T) -> Self {
resource.clone().into() resource.clone().into()
} }

View file

@ -172,15 +172,6 @@ pub trait Device: Sized {
/// All submitted commands that refer to this query pool must have completed. /// All submitted commands that refer to this query pool must have completed.
unsafe fn fetch_query_pool(&self, pool: &Self::QueryPool) -> Result<Vec<f64>, Error>; unsafe fn fetch_query_pool(&self, pool: &Self::QueryPool) -> Result<Vec<f64>, Error>;
#[deprecated]
unsafe fn run_cmd_buf(
&self,
cmd_buf: &Self::CmdBuf,
wait_semaphores: &[Self::Semaphore],
signal_semaphores: &[Self::Semaphore],
fence: Option<&Self::Fence>,
) -> Result<(), Error>;
unsafe fn run_cmd_bufs( unsafe fn run_cmd_bufs(
&self, &self,
cmd_buf: &[&Self::CmdBuf], cmd_buf: &[&Self::CmdBuf],

View file

@ -701,40 +701,6 @@ impl crate::Device for VkDevice {
Ok(result) Ok(result)
} }
/// Run the command buffer.
///
/// This submits the command buffer for execution. The provided fence
/// is signalled when the execution is complete.
unsafe fn run_cmd_buf(
&self,
cmd_buf: &CmdBuf,
wait_semaphores: &[Self::Semaphore],
signal_semaphores: &[Self::Semaphore],
fence: Option<&Self::Fence>,
) -> Result<(), Error> {
let device = &self.device.device;
let fence = match fence {
Some(fence) => *fence,
None => vk::Fence::null(),
};
let wait_stages = wait_semaphores
.iter()
.map(|_| vk::PipelineStageFlags::ALL_COMMANDS)
.collect::<Vec<_>>();
device.queue_submit(
self.queue,
&[vk::SubmitInfo::builder()
.command_buffers(&[cmd_buf.cmd_buf])
.wait_semaphores(wait_semaphores)
.wait_dst_stage_mask(&wait_stages)
.signal_semaphores(signal_semaphores)
.build()],
fence,
)?;
Ok(())
}
/// Run the command buffers. /// Run the command buffers.
/// ///
/// This submits the command buffer for execution. The provided fence /// This submits the command buffer for execution. The provided fence