mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 08:13:27 +00:00
rust: compute resource binding
This commit is contained in:
parent
45def95763
commit
444da40484
@ -35,6 +35,10 @@ pub struct BindGroupLayout {
|
||||
id: wgn::BindGroupLayoutId,
|
||||
}
|
||||
|
||||
pub struct BindGroup {
|
||||
id: wgn::BindGroupId,
|
||||
}
|
||||
|
||||
pub struct ShaderModule {
|
||||
id: wgn::ShaderModuleId,
|
||||
}
|
||||
@ -59,6 +63,10 @@ pub struct RenderPipeline {
|
||||
id: wgn::RenderPipelineId,
|
||||
}
|
||||
|
||||
pub struct ComputePipeline {
|
||||
id: wgn::ComputePipelineId,
|
||||
}
|
||||
|
||||
pub struct CommandBuffer {
|
||||
id: wgn::CommandBufferId,
|
||||
}
|
||||
@ -273,7 +281,16 @@ impl<'a> ComputePass<'a> {
|
||||
wgn::wgpu_compute_pass_end_pass(self.id);
|
||||
self.parent
|
||||
}
|
||||
pub fn dispatch(&self, x: u32, y: u32, z: u32) {
|
||||
|
||||
pub fn set_bind_group(&mut self, index: u32, bind_group: &BindGroup) {
|
||||
wgn::wgpu_compute_pass_set_bind_group(self.id, index, bind_group.id);
|
||||
}
|
||||
|
||||
pub fn set_pipeline(&mut self, pipeline: &ComputePipeline) {
|
||||
wgn::wgpu_compute_pass_set_pipeline(self.id, pipeline.id);
|
||||
}
|
||||
|
||||
pub fn dispatch(&mut self, x: u32, y: u32, z: u32) {
|
||||
wgn::wgpu_compute_pass_dispatch(self.id, x, y, z);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user