Open mingweiLIU opened 1 month ago
On Windows, did you build it by setting DILIGENT_NO_WEBGPU=OFF
CMake variable?
When building for the Web, WebGPU backend is enabled by default. To use it, you initialize it like any other backend. Here is an example. The only caveat is that the device needs to be preinitialized in java script.
after setting DILIGENT_NO_WEBGPU OFF there is no conflict while some errors about JSON parsing, the errors just like:
In file included from E:/DilligentEngine/webgpu/DiligentTools/RenderStateNotation/src/RenderStateNotationParserImpl.cpp:27: In file included from E:/DilligentEngine/webgpu/DiligentTools/RenderStateNotation/include\pch.h:36: E:/DilligentEngine/webgpu/build/Emscripten/DiligentTools/RenderStateNotation/parser_headers\generated/CommonParser.hpp:83:10: error: no matching member function for call to 'get_to' 83 | Json.get_to(pObject); | ~~~~~^~~~~~ E:/DilligentEngine/webgpu/DiligentTools/RenderStateNotation/src/RenderStateNotationParserImpl.cpp:70:9: note: in instantiation of function template specialization 'Diligent::ParseRSN<Diligent::PipelineStateDesc, true>' requested here 70 | ParseRSN(Json["PSODesc"], Type.PSODesc, Allocator); | ^ E:/DilligentEngine/webgpu/DiligentTools/ThirdParty/json/single_include/nlohmann\json.hpp:21100:17: note: candidate template ignored: requirement 'detail::has_from_json<nlohmann::basic_json<std::map, std::vector, std::string, bool, long long, unsigned long long, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>, void>, Diligent::PipelineStateDesc, void>::value' was not satisfied [with ValueType = Diligent::PipelineStateDesc] 21100 | ValueType & get_to(ValueType& v) const noexcept(noexcept(
What is your build setup?
Environment:Windows & Emscripten SDK 3.1.65 & Ninja 1.10.2 generation command:emcmake cmake -S . -B ./build/Emscripten -G "Ninja" -DDILIGENT_NO_WEBGPU=OFF build command:cmake --build ./build/Emscripten
I am now confused what you trying to do.
DILIGENT_NO_WEBGPU=OFF
is set by default and does not need to be set explicitly. WebGPU is enabled automatically.Did you follow the Emscripten build instructions?
Yes,I followed the instuctions, and the reason why I used -DDILIGENT_NO_WEBGPU=OFF is that I had set the WebGPU ON and used dawn to build native application, I used the option to force it to be off.
If you are building for the Web, please follow these instructions that detail how to build and run the samples in the browser.
If you are building native application and want to enable WebGPU, use -DDILIGENT_NO_WEBGPU=OFF
. You should not need anything besides that.
Yes, I followed the instructions for build_and_run_emscripten, the errors are same.
Honestly, I don't know what the problem is. Here is the last CI build that uses same setup and works without issues
There may be some errors in my compile environment since cmake log shows can‘t find the ASM compiler, however I can't fix it currently.
Hi, I am building DiligentEngine using Emscripten on Windows with WebGPU, and I used dawn as the native implementation of WebGPU, there are a lot of type name errors, such as :
and there seems no document about how to build DiligentEngine to run on the browser with WebGPU.