mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-21 22:33:49 +00:00
Basic compute passes on Rust side
This commit is contained in:
parent
1752754489
commit
a00c23e350
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user