mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +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,
|
parent: &'a mut CommandBuffer,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub struct ComputePass<'a> {
|
||||||
|
id: wgn::ComputePassId,
|
||||||
|
parent: &'a mut CommandBuffer,
|
||||||
|
}
|
||||||
|
|
||||||
pub struct Queue {
|
pub struct Queue {
|
||||||
id: wgn::QueueId,
|
id: wgn::QueueId,
|
||||||
}
|
}
|
||||||
@ -247,6 +252,13 @@ impl CommandBuffer {
|
|||||||
parent: self,
|
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> {
|
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 {
|
impl Queue {
|
||||||
pub fn submit(&self, command_buffers: &[CommandBuffer]) {
|
pub fn submit(&self, command_buffers: &[CommandBuffer]) {
|
||||||
wgn::wgpu_queue_submit(
|
wgn::wgpu_queue_submit(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user