mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-21 06:50:59 +01:00
Basic compute passes on Rust side
This commit is contained in:
1 parent
1752754489
commit
a00c23e350
1 file changed
+19
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user