Add memory barrier to ComputePass

We need to be able to call memory_barrier() on ComputePass, to avoid the borrow checker complaining if we tried to call it on the underlying command buffer.
This commit is contained in:
Raph Levien 2022-04-20 15:13:54 -07:00
parent 5a9b8d9243
commit ea0fbab8aa

View file

@ -743,6 +743,15 @@ impl<'a> ComputePass<'a> {
.dispatch(pipeline, descriptor_set, workgroup_count, workgroup_size);
}
/// Add a memory barrier.
///
/// Inserts a memory barrier in the compute encoder. This is a convenience
/// function for calling the same function on the underlying command buffer,
/// avoiding borrow check issues.
pub unsafe fn memory_barrier(&mut self) {
self.cmd_buf.memory_barrier();
}
pub unsafe fn end(self) {
self.cmd_buf.cmd_buf().end_compute_pass();
}