-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile error with --target=wasm32-unknown-unknown #298
Comments
Hi @Kimbatt! How do you use wgpu-native with the wasm32-unknown-unknown target? I think we could probably fix this either way, but the wasm32-unknown-unknown target is usually handled by using wgpu directly instead of wgpu-native. |
Hi, Maybe I don't even need wasm32-unknown-unknown; I found wasm32-unknown-emscripten, which got me a bit closer to the solution. (this also has the compile errors I've mentioned above, in addition to some additional errors) I compiled wgpu-native to a static library, then I linked that to the c++ application.
I found a workaround, adding this to the linker flags fixed it.
I added an empty c++ function with this name to "fix" this.
It seems like
|
Hi @Kimbatt, did you manage to solve this problem? I've found this validation error recently in upstream Rust This is the relevant discussion: gfx-rs/wgpu#5190 It worked for me in my pure Rust project, so it's very likely it will work for yours. I'm now facing the challenge of compiling C and Rust together under the same binary for |
If I remember correctly, the validation issue happened because I didn't use the correct version of the header in the c++ program. I also switched to wasm32-unknown-emscripten. |
Since commit 07728a35c5e0736c3cec99e7fd9ec33161dbc6fb, webassembly builds fail with this error:
(and more similar errors)
It seems like the error happens because in lib.rs, the
handle_error_fatal
andhandle_error
functions require thecause
parameter to be Send + Sync, but this should only be required in non-webassembly builds (in wgpu-core/src/error.rs,ContextError
doesn't have this requirement in webassembly builds).Adding cfg-s to disable the requirements in webassembly builds seems to fix the issue.
(lib.rs, the
cause
parameter of error handling functions, and the variants ofError
enum)The text was updated successfully, but these errors were encountered: