-
Notifications
You must be signed in to change notification settings - Fork 3.2k
enable using vcpkg for Dawn #24699
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
enable using vcpkg for Dawn #24699
Conversation
a797876
to
511ac36
Compare
60e2c45
to
ad12b0e
Compare
The Java binding is failing on macOS. @Craigacp could you please help to take a look at it? I need to add build flag To reproduce the issue locally, use the following build command line:
|
I'm a bit confused about what the context is here. Why would the Java binding be available in a context where webgpu was being used? |
The name of "WebGPU" is confusing. Let me try to explain it a little bit. WebGPU is a web standard initially, which is designed for web (browser environment). However, Dawn, the native implementation of WebGPU can be integrated to native so that we can leverage the GPU capabilities in non-browser environment too. In this context, "WebGPU" means the WebGPU EP, which uses the native port of webgpu (webgpu.h and the native implementation). So, since it is native, it should work with language bindings including Java binding. In the build, dawn will be compiled into a dynamic library (libwebgpu_dawn.dylib on macOS) and WebGPU EP will load it at runtime. |
Oh ok. I'll take a look. |
Ok, if |
This diff was sufficient to make the Java tests pass:
I've not checked to see if that causes problems when Dawn isn't present. We typically have a little more conditionality in the loading to avoid causing trouble (e.g. turning it off when on Android), but I'm not really sure when it's going to be packaged in, or if we want to let users override the location. If you can tell me a little more about it then I can try to figure out what guards we need. |
076db09
to
d1b2836
Compare
@Craigacp thank you for the explanation! The CI failure shows that Is there a way to create a boolean value depending on build flags in Java? Specifically, the following C++ code does it: #if defined(BUILD_DAWN_MONOLITHIC_LIBRARY)
constexpr bool SHOULD_LOAD_DAWN_DYNAMIC_LIB = true;
#else
constexpr bool SHOULD_LOAD_DAWN_DYNAMIC_LIB = false;
#endif |
Unfortunately Java doesn't have conditional compilation, so we'll need another signalling mechanism. Modifying the load method to make it allow optional values so we can load it if it's present is probably the best way. |
8739f01
to
868e075
Compare
The "webgpu_build_x64_RelWithDebInfo" pipeline did not run. |
"webgpu_build_x64_RelWithDebInfo" is not becoming 2 runs:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really thanks!
Description
Enable vcpkg for webgpu
Motivation and Context