You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code in wgpu-hal/src/gles/egl.rs triggers a bug in cbindgen:
#[cfg(not(feature = "emscripten"))]
type EglInstance = egl::DynamicInstance<egl::EGL1_4>;
#[cfg(feature = "emscripten")]
type EglInstance = egl::Instance<egl::Static>;
As described in mozilla/cbindgen#286, cbindgen stumbles when the same name refers to a generic type in one module and a non-generic type in another, and then a type alias is introduced for one in the scope of the other. (As the docs warn, cbindgen doesn't really understand Rust modules).
To reproduce, run cbindgen --lang C in the wgpu-hal directory (using cbindgen version 0.19.0). For me, this panics:
thread 'main' panicked at 'Instance is not generic', src/bindgen/ir/opaque.rs:105:9
This is obviously a cbindgen bug, not wgpu's problem. But comments in the cbindgen issue linked above ominously suggest that this is a consequence of mozilla/cbindgen#7, which seems like a pretty difficult architectural issue to fix. So I think it makes sense for wgpu to work around it.
The text was updated successfully, but these errors were encountered:
jimblandy
added a commit
to jimblandy/wgpu
that referenced
this issue
Apr 3, 2022
The definition of `EglInstance` trips mozilla/cbindgen#286. Since
the `wgpu_hal::gles::egl` module is an implementation detail anyway,
it should be harmless to ask cbindgen to just ignore it.
Fixesgfx-rs#2575.
The following code in
wgpu-hal/src/gles/egl.rs
triggers a bug in cbindgen:As described in mozilla/cbindgen#286, cbindgen stumbles when the same name refers to a generic type in one module and a non-generic type in another, and then a type alias is introduced for one in the scope of the other. (As the docs warn, cbindgen doesn't really understand Rust modules).
To reproduce, run
cbindgen --lang C
in thewgpu-hal
directory (using cbindgen version 0.19.0). For me, this panics:This is obviously a cbindgen bug, not wgpu's problem. But comments in the cbindgen issue linked above ominously suggest that this is a consequence of mozilla/cbindgen#7, which seems like a pretty difficult architectural issue to fix. So I think it makes sense for wgpu to work around it.
The text was updated successfully, but these errors were encountered: