remove end pass return value and fix examples

This commit is contained in:
Fabio Krapohl 2019-08-10 22:30:24 +02:00
parent 186fbeec36
commit 6fee18f6f9
4 changed files with 19 additions and 8 deletions

View File

@ -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);

View File

@ -1,6 +1,6 @@
#define WGPU_LOCAL
/* Generated with cbindgen:0.9.0 */
/* Generated with cbindgen:0.8.7 */
#include <stdarg.h>
#include <stdbool.h>
@ -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);

View File

@ -46,7 +46,7 @@ impl<B: hal::Backend> ComputePass<B> {
// 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]

View File

@ -174,7 +174,7 @@ impl<B: hal::Backend> RenderPass<B> {
// 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]