Skip to content

Commit c89603c

Browse files
Implement wgpuInstanceProcessEvents (#430)
* Implement wgpuInstanceProcessEvents * Fix formatting --------- Co-authored-by: Almar Klein <[email protected]>
1 parent 7d26b99 commit c89603c

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

src/lib.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2692,6 +2692,19 @@ pub unsafe extern "C" fn wgpuInstanceCreateSurface(
26922692
}))
26932693
}
26942694

2695+
#[no_mangle]
2696+
pub unsafe extern "C" fn wgpuInstanceProcessEvents(instance: native::WGPUInstance) {
2697+
let instance = instance.as_ref().expect("invalid instance");
2698+
let context = &instance.context;
2699+
2700+
match context.poll_all_devices(false) {
2701+
Ok(_queue_empty) => (),
2702+
Err(cause) => {
2703+
handle_error_fatal(cause, "wgpuInstanceProcessEvents");
2704+
}
2705+
}
2706+
}
2707+
26952708
#[no_mangle]
26962709
pub unsafe extern "C" fn wgpuInstanceRequestAdapter(
26972710
instance: native::WGPUInstance,

src/unimplemented.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,6 @@ pub extern "C" fn wgpuInstanceHasWGSLLanguageFeature(
112112
unimplemented!();
113113
}
114114

115-
#[no_mangle]
116-
pub extern "C" fn wgpuInstanceProcessEvents(_instance: native::WGPUInstance) {
117-
unimplemented!();
118-
}
119-
120115
#[no_mangle]
121116
pub extern "C" fn wgpuPipelineLayoutSetLabel(
122117
_pipeline_layout: native::WGPUPipelineLayout,

0 commit comments

Comments
 (0)