MoltenVK
是一个软件库,允许Vulkan
应用程序在Apple
的macOS
和iOS
操作系统上运行在Metal
之上。它是Vulkan Portability Initiative
发布的第一个软件组件,该项目是在没有本地Vulkan
驱动程序的平台上运行Vulkan
子集的项目。
下载并编译 MoltenVK
的代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
$ cd ~ $ brew install cmake $ brew install python $ brew install ninja $ git clone https://github.com/KhronosGroup/MoltenVK.git $ cd MoltenVK $ bash fetchDependencies $ make $ make macos $ export VK_ICD_FILENAMES=~/MoltenVK/Package/Release/MoltenVK/macOS/dynamic/MoltenVK_icd.json |
下载并编译 vuh
的代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
$ git clone https://github.com/Glavnokoman/vuh.git $ cd vuh $ export DEPENDENCIES_INSTALL_DIR=. $ export VUH_SOURCE_DIR=. $ export PATH="/usr/local/bin:$PATH" $ brew install python $ brew install python2 $ brew install glslang $ brew install spdlog $ sudo python -m pip install --upgrade pip $ python -m pip install cget $ export BINPATH=`python -c 'import imp; import os; mod=imp.find_module("cget")[1]; root=os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(mod))))); print os.path.join(root,"bin")'` $ export PATH="$BINPATH:$PATH" $ export CGET_PREFIX=${DEPENDENCIES_INSTALL_DIR} $ bash ${VUH_SOURCE_DIR}/config/install_dependencies.sh $ export VULKAN_SDK=$(cd "$(dirname ${DEPENDENCIES_INSTALL_DIR})";pwd) $ export Catch2_DIR=$(cd "$(dirname ${DEPENDENCIES_INSTALL_DIR})";pwd) $ cmake -DCMAKE_PREFIX_PATH=${DEPENDENCIES_INSTALL_DIR} ${VUH_SOURCE_DIR} $ cmake --build . --target install |
执行测试:
1 |
$ ${VUH_SOURCE_DIR}/test/correctness/test_vuh |