mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-21 22:33:49 +00:00
Compute dispatch call
This commit is contained in:
parent
15883ab21c
commit
dd681d2c77
@ -1,11 +1,12 @@
|
||||
use hal;
|
||||
|
||||
use registry::{HUB, Items, Registry};
|
||||
use {
|
||||
Stored,
|
||||
CommandBufferId, ComputePassId
|
||||
};
|
||||
|
||||
use hal;
|
||||
use hal::command::RawCommandBuffer;
|
||||
|
||||
|
||||
pub struct ComputePass<B: hal::Backend> {
|
||||
raw: B::CommandBuffer,
|
||||
@ -35,3 +36,13 @@ pub extern "C" fn wgpu_compute_pass_end_pass(
|
||||
.raw = Some(pass.raw);
|
||||
pass.cmb_id.0
|
||||
}
|
||||
|
||||
pub extern "C" fn wgpu_compute_pass_dispatch(
|
||||
pass_id: ComputePassId, x: u32, y: u32, z: u32,
|
||||
) {
|
||||
HUB.compute_passes
|
||||
.lock()
|
||||
.get_mut(pass_id)
|
||||
.raw
|
||||
.dispatch([x, y, z]);
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
use hal;
|
||||
use hal::command::RawCommandBuffer;
|
||||
|
||||
use registry::{HUB, Items, Registry};
|
||||
use {
|
||||
Stored,
|
||||
CommandBufferId, RenderPassId,
|
||||
};
|
||||
|
||||
use hal;
|
||||
use hal::command::RawCommandBuffer;
|
||||
|
||||
|
||||
pub struct RenderPass<B: hal::Backend> {
|
||||
raw: B::CommandBuffer,
|
||||
|
@ -273,6 +273,9 @@ impl<'a> ComputePass<'a> {
|
||||
wgn::wgpu_compute_pass_end_pass(self.id);
|
||||
self.parent
|
||||
}
|
||||
pub fn dispatch(&self, x: u32, y: u32, z: u32) {
|
||||
wgn::wgpu_compute_pass_dispatch(self.id, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
impl Queue {
|
||||
|
Loading…
Reference in New Issue
Block a user