diff --git a/examples/hello_triangle_c/main.c b/examples/hello_triangle_c/main.c index 6c95c0861..e2536cba7 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 7ed561659..33893c36f 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)