Using Godot with SwiftShader Vulkan software emulation

  1. Download SwiftShader source - https://swiftshader.googlesource.com/SwiftShader/
    git clone https://swiftshader.googlesource.com/SwiftShader

  2. Build SwiftShader ICD as described in https://swiftshader.googlesource.com/SwiftShader/#building
    Note: Disable GL/EGL and ANGLE related build features (SWIFTSHADER_BUILD_ANGLE, SWIFTSHADER_BUILD_EGL, SWIFTSHADER_BUILD_GLES_CM, SWIFTSHADER_BUILD_GLESv2, SWIFTSHADER_BUILD_PVR) for the faster build time.
  3. Download master branch of Godot - https://github.com/godotengine/godot
    git clone https://github.com/godotengine/godot.git
  4. Download apply following patch to Godot source to disable tessellation check - patch_vm_vlk_godot.diff
    git apply patch_vm_vlk_godot.diff
  5. Build Godot as described in https://docs.godotengine.org/en/latest/development/compiling/index.html
  6. Create SwiftShaderICD.json file with the following content:
    {
        "file_format_version" : "1.0.0",
        "ICD": {
            "library_path": "{ABSOLUTE_PATH_TO}/libvk_swiftshader.so",
            "api_version" : "1.0.0"
        }
    }
  7. Run Godot using following command (executable name may vary depending on build config):
    VK_ICD_FILENAMES=./SwiftShaderICD.json ./godot.linuxbsd.tools.64

This article was updated on January 7, 2021