Skip to content

Latest commit

 

History

History
41 lines (37 loc) · 1.46 KB

README.md

File metadata and controls

41 lines (37 loc) · 1.46 KB

twgsl

twgsl (from "to WGSL") is a small "adapter" layer exposing the SPIR-V to WGSL transpilation capabilities of Google's Tint library to JavaScript.

Building twgsl

I recommend building from a Linux VM set up explicitly for this purpose.

  1. Set up Emscripten, making sure to add its tools to your path.
  2. Set up Chrome Depot Tools, making sure to add the tools to your path.
  3. Clone twgsl and download the Tint submodule.
    git clone https://github.com/BabylonJS/twgsl.git
    cd twgsl
    git submodule update --init --recursive
    
  4. Set up the Tint repository to build.
    cd Dependencies/Tint
    cp standalone.gclient .gclient
    gclient sync
    
  5. Create a build folder outside the twgsl folder (assumed in this example to be adjacent), then configure cmake using Emscripten's CMake wrapper.
    mkdir twgsl_build
    cd twgsl_build
    emcmake cmake ../twgsl
    
  6. Build the twgsl target using Emscripten's Make wrapper.
    emmake make twgsl
    
    Significant optimizations are turned on, so this build may take a very long time.