-
Notifications
You must be signed in to change notification settings - Fork 186
Building WASM samples #342
Comments
Hi! The examples will only build on In Chrome Canary, the In Firefox Nightly, do you have both WebGPU ( There are some details in https://github.com/gpuweb/gpuweb/wiki/Implementation-Status#implementation-status about how to configure each browser with experimental WebGPU support. The MIME type warning is related the npm package you're using ( I see the closure invoked recursively error occasionally so we still need to look into that and see where it's coming from. Although this doesn't seem to stop the examples from running ok -- you should be able to see some output at https://wgpu.rs/examples/ by clicking through the examples at (you might need to refresh the page if they don't load, or restart your browser). |
Ok interesting findings here. I am trying to run another example locally but so far I am failing. I will report details later while I have a better understanding. Just to double check is the nightly toolchain required to run such samples? M. |
@giordi91 the hello-triangle just has a problem with presentation on Gecko, it's filed as https://bugzilla.mozilla.org/show_bug.cgi?id=1628400 . It doesn't actually do anything, just the logic of showing the results isn't fleshed out yet. Notably, it's easy to work around in your app by just requesting the redraw constantly. |
@kvark Interesting. I will have a look at the other samples then.
C:\WORK_IN_PROGRESS\compile\wgpu-rs>cargo run --example cube
|
This is a problem on our side that I introduced, fixing at the moment (sorry about inconvenience!). Please don't mix native and WASM issues in the same issue here. |
@kvark apologies for hijacking the issue. In general is it fine to open wasm related issues on this repository or is there a different place suited for that? |
It's totally appropriate to file WASM issues here. Most native issues would go to https://github.com/gfx-rs/wgpu, although we can move an issue with no problem if you create it here. |
Thank you for al the help. Closing now. |
342: Fallback to D32 when D24 isn't available r=kvark a=grovesNL The rationale is that D32 seems to be supported on more devices. Using D24 could be a future memory/performance optimization instead. Otherwise if it's fairly trivial I could add the fallback path for D32 here instead, but I'm not sure how we intend for values in the `D24Unorm` depth range to work in general (i.e. compared to `D32Sfloat`). Maybe I missed some discussion about this, but I don't see it in the minutes. cc @Yatekii Co-authored-by: Joshua Groves <josh@joshgroves.com>
Good afternoon, I have been trying to build the samples to run in the browser and failed so far. here is what I tried.
I have been using the following browsers:
Firefox Nightly :
Chrome with wgpu enabled:
From master:
I have simply cloned master and built hello-triangle and describe. In order to get a successful compilation I had to downgrade
cc
package as per: gfx-rs/wgpu#464I have been trying to run hello-triangle and describe.
** Firefox / describe sample**
If I run with the suggested python server I get a mime mismatch for JS and flat out fail. So I decided to run with
npx http-server path/to/code/
, which seems to address the js MIME but not the WASM one, giving the following warning:From the sounds of it, it seems like it should still be able to run, but does not seem the case. Nothing happens no other errors
** Chrome / describe sample**
It seems like no adapter was found?
** Firefox / hello-triangle samle**
Here I get the same warning from the MIME of the WASM and a black screen, plus the control flow exceptions:
From time to time I also get a closure error:
I am fairly new to Rust and the error is possibly related to this? https://www.reddit.com/r/WebAssembly/comments/e2rclj/beginner_wasm_rust_throw_closure_invoked/
** Chrome / hello-triangle sample**
Seems to still be hanging on the same problem.
I have been compiling this with the nightly toolchain as well, did not make any difference.
I also tried to compile for v0.5 but compilation fails. (There are no instructions in the readme for v0.5 about WASM so I am not sure if it is supported).
Here compilation log:
Any idea of what I might be doing wrong or how to proceed in debugging this? In my specific case, I am trying to get a simple example working for both rust native and wasm such that I can build on top of.
Thank you very much
The text was updated successfully, but these errors were encountered: