diff --git a/examples/triangle/main.c b/examples/triangle/main.c index 2b7eea6e1..8540922d6 100644 --- a/examples/triangle/main.c +++ b/examples/triangle/main.c @@ -237,7 +237,8 @@ int main() { wgpu_render_pass_set_bind_group(rpass, 0, bind_group, NULL, 0); wgpu_render_pass_draw(rpass, 3, 1, 0, 0); WGPUQueueId queue = wgpu_device_get_queue(device); - WGPUCommandBufferId cmd_buf = wgpu_render_pass_end_pass(rpass); + wgpu_render_pass_end_pass(rpass); + WGPUCommandBufferId cmd_buf = wgpu_command_encoder_finish(cmd_encoder); wgpu_queue_submit(queue, &cmd_buf, 1); wgpu_swap_chain_present(swap_chain); diff --git a/ffi/wgpu.h b/ffi/wgpu.h index 9208a109e..e461b76f6 100644 --- a/ffi/wgpu.h +++ b/ffi/wgpu.h @@ -1,6 +1,6 @@ #define WGPU_LOCAL -/* Generated with cbindgen:0.9.0 */ +/* Generated with cbindgen:0.8.7 */ #include #include @@ -680,7 +680,11 @@ WGPUCommandBufferId wgpu_command_encoder_finish(WGPUCommandEncoderId command_enc void wgpu_compute_pass_dispatch(WGPUComputePassId pass_id, uint32_t x, uint32_t y, uint32_t z); -WGPUCommandBufferId wgpu_compute_pass_end_pass(WGPUComputePassId pass_id); +void wgpu_compute_pass_dispatch_indirect(WGPUComputePassId pass_id, + WGPUBufferId indirect_buffer_id, + WGPUBufferAddress indirect_offset); + +void wgpu_compute_pass_end_pass(WGPUComputePassId pass_id); void wgpu_compute_pass_insert_debug_marker(WGPUComputePassId _pass_id, WGPURawString _label); @@ -804,7 +808,15 @@ void wgpu_render_pass_draw_indexed(WGPURenderPassId pass_id, int32_t base_vertex, uint32_t first_instance); -WGPUCommandBufferId wgpu_render_pass_end_pass(WGPURenderPassId pass_id); +void wgpu_render_pass_draw_indexed_indirect(WGPURenderPassId pass_id, + WGPUBufferId indirect_buffer_id, + WGPUBufferAddress indirect_offset); + +void wgpu_render_pass_draw_indirect(WGPURenderPassId pass_id, + WGPUBufferId indirect_buffer_id, + WGPUBufferAddress indirect_offset); + +void wgpu_render_pass_end_pass(WGPURenderPassId pass_id); void wgpu_render_pass_insert_debug_marker(WGPURenderPassId _pass_id, WGPURawString _label); diff --git a/wgpu-native/src/command/compute.rs b/wgpu-native/src/command/compute.rs index a2bf00ecf..209ea2f4e 100644 --- a/wgpu-native/src/command/compute.rs +++ b/wgpu-native/src/command/compute.rs @@ -46,7 +46,7 @@ impl ComputePass { // Common routines between render/compute #[no_mangle] -pub extern "C" fn wgpu_compute_pass_end_pass(pass_id: ComputePassId) -> CommandBufferId { +pub extern "C" fn wgpu_compute_pass_end_pass(pass_id: ComputePassId) { let mut token = Token::root(); let (mut cmb_guard, mut token) = HUB.command_buffers.write(&mut token); let (pass, _) = HUB.compute_passes.unregister(pass_id, &mut token); @@ -56,7 +56,6 @@ pub extern "C" fn wgpu_compute_pass_end_pass(pass_id: ComputePassId) -> CommandB // into the parent command buffer while recording this compute pass. cmb.trackers = pass.trackers; cmb.raw.push(pass.raw); - pass.cmb_id.value } #[no_mangle] diff --git a/wgpu-native/src/command/render.rs b/wgpu-native/src/command/render.rs index 909816c44..decb68333 100644 --- a/wgpu-native/src/command/render.rs +++ b/wgpu-native/src/command/render.rs @@ -174,7 +174,7 @@ impl RenderPass { // Common routines between render/compute #[no_mangle] -pub extern "C" fn wgpu_render_pass_end_pass(pass_id: RenderPassId) -> CommandBufferId { +pub extern "C" fn wgpu_render_pass_end_pass(pass_id: RenderPassId) { let mut token = Token::root(); let (mut cmb_guard, mut token) = HUB.command_buffers.write(&mut token); let (mut pass, mut token) = HUB.render_passes.unregister(pass_id, &mut token); @@ -204,7 +204,6 @@ pub extern "C" fn wgpu_render_pass_end_pass(pass_id: RenderPassId) -> CommandBuf } cmb.raw.push(pass.raw); - pass.cmb_id.value } #[no_mangle]