diff --git a/build_scripts/build_usd.py b/build_scripts/build_usd.py index 5baad835ce..c534698010 100644 --- a/build_scripts/build_usd.py +++ b/build_scripts/build_usd.py @@ -91,6 +91,8 @@ def GetBuildTargets(): return apple_utils.GetBuildTargets() + [TARGET_WASM, TARGET_WASM_NODE] elif Linux(): return [TARGET_WASM, TARGET_WASM_NODE] + elif Windows(): + return [TARGET_WASM, TARGET_WASM_NODE] else: return [] @@ -987,6 +989,10 @@ def InstallBoost(context, force, buildArgs): def InstallOneTBB(context, force, buildArgs): with CurrentWorkingDirectory(DownloadURL(ONETBB_URL, context, force)): + if context.targetWasm: + PatchFile("cmake/compilers/Clang.cmake", + [("if (CMAKE_SYSTEM_PROCESSOR MATCHES \"(AMD64|amd64|i.86|x86)\")", + "if (CMAKE_SYSTEM_PROCESSOR MATCHES \"(AMD64|amd64|i.86|x86)\" AND NOT EMSCRIPTEN)")]) RunCMake(context, force, ['-DTBB_TEST=OFF', '-DTBB_STRICT=OFF'] + buildArgs) diff --git a/pxr/base/tf/diagnostic.cpp b/pxr/base/tf/diagnostic.cpp index dbb6ea9b94..c5087493a2 100644 --- a/pxr/base/tf/diagnostic.cpp +++ b/pxr/base/tf/diagnostic.cpp @@ -238,7 +238,11 @@ _fatalSignalHandler(int signo) fflush(stderr); // Simulate the exit status of being killed by signal signo - _exit(128 + signo); + #ifdef __EMSCRIPTEN__ + emscripten_force_exit(128 + signo); + #else + _exit(128 + signo); + #endif } void diff --git a/pxr/base/vt/value.h b/pxr/base/vt/value.h index ec95e0228c..07fc5fd8c7 100644 --- a/pxr/base/vt/value.h +++ b/pxr/base/vt/value.h @@ -14,9 +14,7 @@ #include "pxr/base/tf/pyObjWrapper.h" #if PXR_JS_BINDINGS_SUPPORT_ENABLED -#include "pxr/usd/sdf/wrapPathJs.h" #include "pxr/base/tf/wrapTokenJs.h" -#include "pxr/usd/sdf/wrapAssetPathJs.h" #include #endif // PXR_JS_BINDINGS_SUPPORT_ENABLED diff --git a/pxr/usd/sdf/CMakeLists.txt b/pxr/usd/sdf/CMakeLists.txt index af197b220d..62dfa5913f 100644 --- a/pxr/usd/sdf/CMakeLists.txt +++ b/pxr/usd/sdf/CMakeLists.txt @@ -11,6 +11,7 @@ pxr_library(sdf ts vt work + usd ar ${Boost_PYTHON_LIBRARY} ${TBB_tbb_LIBRARY} diff --git a/pxr/usdImaging/bin/usdviewweb/README.md b/pxr/usdImaging/bin/usdviewweb/README.md index ada55fb403..89c4bb236f 100644 --- a/pxr/usdImaging/bin/usdviewweb/README.md +++ b/pxr/usdImaging/bin/usdviewweb/README.md @@ -29,21 +29,33 @@ source ./emsdk_env.sh # Download and install the latest SDK tools. emsdk install 3.1.66 -# Make the specific SDK for the current user. (writes .emscripten file) +# Activate the specific SDK for the current user. (writes .emscripten file) emsdk activate 3.1.66 ``` +Depending on your current system configuration additional build tools may be required, for example + +``` +# Download and install MinGW. +emsdk install mingw-4.6.2-32bit + +# Activate a specific MinGW installation. +emsdk activate mingw-4.6.2-32bit +``` + +Note! Run emsdk activate every time you open a new powershell. The above commands will not update the system PATH permanently. + ## Build USD to WebAssembly ``` # Clone the USD source code git clone --recursive https://git.autodesk.com/autodesk-forks/usd/tree/adsk/feature/webgpu -# Go into the root of usd source repo, if the folder name is "usd_repo" -cd usd_repo +# Go into the root of usd source repo, if the folder name is "USD" +cd USD # Build USD with --build-target wasm , where "../build_dir" is your local build folder -python3 ./build_scripts/build_usd.py --build-target wasm ../build_dir +python3 ./build_scripts/build_usd.py --build-target wasm --onetbb ../build_dir ``` This also builds the UsdViewWeb application, which you can use to test Hydra Storm with the WebGPU backend. @@ -54,7 +66,7 @@ Start a web server in the build dir with the appropriate flags. Go into the /bin folder first. ``` -python ./wasm-server.py +python3 ./wasm-server.py ``` ## Browser Requirements