jhanssen / fwgsl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About


Languages

Language:C++ 77.6%Language:CMake 15.4%Language:JavaScript 7.0%