Skip to content
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

support for emscripten build #171

Closed
wants to merge 2 commits into from
Closed

Conversation

caiiiycuk
Copy link

@caiiiycuk caiiiycuk commented Feb 3, 2022

Added support for emscripten build. It's draft because, I am waiting for completion of other PRs (wgpu, headers).
Also, how I can edit wiki to add emscripten instructions?

--
изображение

@caiiiycuk caiiiycuk changed the title supoprt for emscripten build support for emscripten build Feb 3, 2022
@caiiiycuk
Copy link
Author

@kvark can we fork webgpu-headers under gfx-rs to apply emscripten workaound? webgpu-native/webgpu-headers#146

@kvark
Copy link
Member

kvark commented Feb 4, 2022

We can, yeah, although it would be good to not do that:)
Didn't you also try to make our ID to be 32bit on those systems?

@caiiiycuk
Copy link
Author

We can, yeah, although it would be good to not do that:) Didn't you also try to make our ID to be 32bit on those systems?

Yes I tried, and this solution also works. But, I really worried that 65536 is too small for index/epoch? Or you think its ok?

--

Another solution that I have in mind is to doing copy of headers and patch them when make:

make lib-native-emscripten

It will cp webgpu.h into emscripten/webgpu.h and patch it. What do you think is it acceptable?

@kvark
Copy link
Member

kvark commented Feb 7, 2022

I think 32-bit indices are acceptable, especially with gfx-rs/wgpu#2462 merged.
It's certainly not ideal, but it should work.

@caiiiycuk caiiiycuk marked this pull request as ready for review February 15, 2022 04:30
@caiiiycuk
Copy link
Author

ready

@caiiiycuk caiiiycuk mentioned this pull request Feb 15, 2022
#version = "0.11"
features = ["raw-window-handle", "id32"]

[target.'cfg(target_os = "emscripten")'.dependencies.hal]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shouldn't be needed - wgpu-core already depends on wgpu-hal with emscripten feature enabled

rev = "8b66507"
# path = "../wgpu/wgpu-core"
#version = "0.11"
features = ["raw-window-handle", "id32"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if wgpu-core could detect the need for id32 automatically? Basically, to make it a platform detection instead of an explicit feature.

@rajveermalviya
Copy link
Collaborator

Closing this as on web/wasm Emscripten provides it's own webgpu.h implementation which binds to the WebGPU JS functions directly. It doesn't make sense for wgpu-native to "support" emscripten if user wants to target browser webgpu.

Only thing wgpu-native can provide in emscripten/wasm context is an implementation of webgpu.h with WebGL2 backend. If that's what users want, then please open a new issue stating your usecase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants