diff --git a/wgpu-rs/src/lib.rs b/wgpu-rs/src/lib.rs index 630074918..3b859990c 100644 --- a/wgpu-rs/src/lib.rs +++ b/wgpu-rs/src/lib.rs @@ -68,6 +68,11 @@ pub struct RenderPass<'a> { parent: &'a mut CommandBuffer, } +pub struct ComputePass<'a> { + id: wgn::ComputePassId, + parent: &'a mut CommandBuffer, +} + pub struct Queue { id: wgn::QueueId, } @@ -247,6 +252,13 @@ impl CommandBuffer { parent: self, } } + + pub fn begin_compute_pass(&mut self) -> ComputePass { + ComputePass { + id: wgn::wgpu_command_buffer_begin_compute_pass(self.id), + parent: self, + } + } } impl<'a> RenderPass<'a> { @@ -256,6 +268,13 @@ impl<'a> RenderPass<'a> { } } +impl<'a> ComputePass<'a> { + pub fn end_pass(self) -> &'a mut CommandBuffer { + wgn::wgpu_compute_pass_end_pass(self.id); + self.parent + } +} + impl Queue { pub fn submit(&self, command_buffers: &[CommandBuffer]) { wgn::wgpu_queue_submit(