Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Target a recent, stable version of the USD main branch. At the time of writing, USD 2223.1105 is the latest known public stable branched version.

Edit: 

High-level prioritized item list

ItemNotesStatus

0. Legal requirements



Clarify ASWF vs. USD contribution guidelines regarding attributions.

1. Build system changes



Add Dockerfile to standardize Emscripten build (using an Ubunutu 22.04 LTS base image)

    • Using known good Emscripten version (2.0.24)
https://github.com/autodesk-forks/USD/blob/adsk/feature/webgpu/DockerfileDone?

Update build_usd.py build script to support:


Done?

Adding an --emscripten build option to specify a WebAssembly target

https://github.com/autodesk-forks/USD/blob/adsk/feature/webgpu/build_scripts/build_usd.py#L2198Done?

Using emcmake/emmake as a drop-in replacement for cmake when targeting WebAssembly build

https://github.com/autodesk-forks/USD/blob/adsk/feature/webgpu/build_scripts/build_usd.py#L442Done?

Replacing TBB with WasmTBB

https://github.com/autodesk-forks/USD/blob/adsk/feature/webgpu/build_scripts/build_usd.py#L956C1-L956C19Done?

Listing USD components incompatible with WebAssembly build to warn Users that Python, usdview, imaging have been disabled

https://github.com/autodesk-forks/USD/blob/adsk/feature/webgpu/build_scripts/build_usd.py#L2588Done?

Add CMakeLists.txt for JavaScript/WebAssembly bindings in order to:

    • List USD binding dependencies (usd, usdLux, usdGeom, usdUtils, sdf, tf)
    • Specify location of WebAssembly build artifacts (WASM bundle, WebWorker, JavaScript bindings)


Include tests to validate WebAssembly build, using a NodeJS dependency in order to enable tests from headless environments. Test examples include (but are not limited to):

    1. Loading a USDA stage
    2. Exporting USDA stage to string
    3. Traversing the USDA stage
    4. Running WebWorkers
    5. etc.
https://github.com/autodesk-forks/USD/tree/adsk/feature/webgpu/js/__tests__Done?

2. Core USD changes



arch library

  • Add #if defined(__EMSCRIPTEN__) guards to integrate Emscripten as an alternative to Linux platform:


pxr/base/arch/debugger.cpp

    • ArchDebuggerTrap()

...

...

    • ArchGetModificationTime()

...

    • ArchGetAccessTime()

...

    • ArchGetStatusChangeTime()

...

    • ArchGetFileLength()

...

https://github.com/autodesk-forks/USD/blob/adsk/feature/webgpu/pxr/base/arch/fileSystem.cpp#L162

https://github.com/autodesk-forks/USD/blob/adsk/feature/webgpu/pxr/base/arch/fileSystem.cpp#L199

https://github.com/autodesk-forks/USD/blob/adsk/feature/webgpu/pxr/base/arch/fileSystem.cpp#L456

https://github.com/autodesk-forks/USD/blob/adsk/feature/webgpu/pxr/base/arch/fileSystem.cpp#L469

https://github.com/autodesk-forks/USD/blob/adsk/feature/webgpu/pxr/base/arch/fileSystem.cpp#L501

https://github.com/autodesk-forks/USD/blob/adsk/feature/webgpu/pxr/base/arch/debugger.cpp#L660

Done?

pxr/base/arch/library.cpp

  • ArchLibraryOpen()
  •  ArchLibraryError()
  • ArchLibraryClose()
  • ArchLibraryGetSymbolAddress()

Necessary? 
  • ArchGetStartTickTime()
  •  ArchGetStopTickTime()

https://github.com/autodesk-forks/USD/blob/adsk/feature/webgpu/pxr/base/arch/timing.h#L76

https://github.com/autodesk-forks/USD/blob/adsk/feature/webgpu/pxr/base/arch/timing.h#L133

Done?



tf library

  • Add type registration for USD symbols to be exposed to/from C++/JavaScript
    • Used to wrap TfToken, double, int, etc.
  • Add TfPointerAndBits to specify operations on 32-bit architectures (as USD only specifies 64-bit operations by default)


vt library

  • Add type registration for USD symbols to be exposed to/from C++/JavaScript
    • Add getJsObj to VtValue (similar to the existing getPyObj for Python)


sdf library

  • Add type registration for USD symbols to be exposed to/from C++/JavaScript
    • Used to wrap SdfPath objects
https://github.com/autodesk-forks/USD/blob/adsk/feature/webgpu/pxr/usd/sdf/wrapPathJs.hDone?

usd library

  • Add type registration for USD symbols to be exposed to/from C++/JavaScript
    • Used to wrap UsdPrim, UsdStage objects to expose CreateNew(), ExportToString() and other API bindings.
https://github.com/autodesk-forks/USD/blob/adsk/feature/webgpu/pxr/usd/usd/wrapStageJs.cpp#L105Done?

3. ThreeJS Hydra renderer



TBD: Separate project/branch? Engage with ThreeJS/web community for collaboration opportunity on this aspect?https://github.com/autodesk-forks/USD/blob/adsk/feature/webgpu/pxr/usdImaging/hdEmscripten/js/ThreeJsRenderDelegate.jsDone?