Basic compute passes on Rust side

This commit is contained in:
Dzmitry Malyshau 2018-10-02 12:32:39 -04:00
parent 1752754489
commit a00c23e350

View File

@ -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(