From 8abc1c2668bda2a0eee92d65885f7de3d237be1f Mon Sep 17 00:00:00 2001 From: Fabio Krapohl Date: Tue, 4 Jun 2019 22:13:48 +0000 Subject: [PATCH] also use pointer for descriptor in `wgpu_command_encoder_begin_render_pass` for consistency reasons --- examples/hello_triangle_c/main.c | 2 +- ffi/wgpu.h | 2 +- wgpu-native/src/command/mod.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/hello_triangle_c/main.c b/examples/hello_triangle_c/main.c index 82dbb864f..a5378fd22 100644 --- a/examples/hello_triangle_c/main.c +++ b/examples/hello_triangle_c/main.c @@ -234,7 +234,7 @@ int main() { WGPURenderPassId rpass = wgpu_command_encoder_begin_render_pass(cmd_encoder, - (WGPURenderPassDescriptor){ + &(WGPURenderPassDescriptor){ .color_attachments = color_attachments, .color_attachments_length = RENDER_PASS_ATTACHMENTS_LENGTH, .depth_stencil_attachment = NULL, diff --git a/ffi/wgpu.h b/ffi/wgpu.h index 4c6b38561..270238d18 100644 --- a/ffi/wgpu.h +++ b/ffi/wgpu.h @@ -670,7 +670,7 @@ WGPUComputePassId wgpu_command_encoder_begin_compute_pass(WGPUCommandEncoderId c #if defined(WGPU_LOCAL) WGPURenderPassId wgpu_command_encoder_begin_render_pass(WGPUCommandEncoderId command_encoder_id, - WGPURenderPassDescriptor desc); + const WGPURenderPassDescriptor *desc); #endif WGPUCommandBufferId wgpu_command_encoder_finish(WGPUCommandEncoderId command_encoder_id); diff --git a/wgpu-native/src/command/mod.rs b/wgpu-native/src/command/mod.rs index 19fbd6003..981f1a6b6 100644 --- a/wgpu-native/src/command/mod.rs +++ b/wgpu-native/src/command/mod.rs @@ -164,7 +164,7 @@ pub extern "C" fn wgpu_command_encoder_finish( pub fn command_encoder_begin_render_pass( command_encoder_id: CommandEncoderId, - desc: RenderPassDescriptor, + desc: &RenderPassDescriptor, ) -> RenderPass { let device_guard = HUB.devices.read(); let mut cmb_guard = HUB.command_buffers.write(); @@ -406,7 +406,7 @@ pub fn command_encoder_begin_render_pass( #[no_mangle] pub extern "C" fn wgpu_command_encoder_begin_render_pass( command_encoder_id: CommandEncoderId, - desc: RenderPassDescriptor, + desc: &RenderPassDescriptor, ) -> RenderPassId { let pass = command_encoder_begin_render_pass(command_encoder_id, desc); HUB.render_passes.register_local(pass)