Fix instructions for running the examples on a Mac. (#609)

- `$VULKAN_SDK` must now be set, and serves as a base value for the other variables;
- ICD and layers moved from the `etc` to `share` subfolder.
This commit is contained in:
James Farrell 2022-04-07 13:47:37 -05:00 committed by GitHub
parent 2a9a59e75c
commit e5c4d11b03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -231,11 +231,14 @@ Make sure that you have a Vulkan ready driver and install the [LunarG Vulkan SDK
#### Linux #### Linux
Make sure that you have a Vulkan ready driver and install the [LunarG Vulkan SDK](https://lunarg.com/vulkan-sdk/). You also have to add the library and layers to your path. Have a look at my [post](http://askubuntu.com/a/803110/77183) if you are unsure how to do that. Make sure that you have a Vulkan ready driver and install the [LunarG Vulkan SDK](https://lunarg.com/vulkan-sdk/). You also have to add the library and layers to your path. Have a look at my [post](http://askubuntu.com/a/803110/77183) if you are unsure how to do that.
#### macOS #### macOS
Install the [LunarG Vulkan SDK](https://lunarg.com/vulkan-sdk/). This basically entails extracting the downloaded tarball to any location you choose and then setting a few environment variables. Specifically, if `SDK_PATH` is set to the root extracted SDK directory, Install the [LunarG Vulkan SDK](https://lunarg.com/vulkan-sdk/). The installer puts the SDK in `$HOME/VulkanSDK/<version>` by default. You will need to set the following environment variables when running cargo:
```sh
* `DYLD_LIBRARY_PATH = $SDK_PATH/macOS/lib` VULKAN_SDK=$HOME/VulkanSDK/<version>/macOS \
* `VK_ICD_FILENAMES = $SDK_PATH/macOS/etc/vulkan/icd.d/MoltenVK_icd.json` DYLD_FALLBACK_LIBRARY_PATH=$VULKAN_SDK/lib \
* `VK_LAYER_PATH = $SDK_PATH/macOS/etc/vulkan/explicit_layer.d` VK_ICD_FILENAMES=$VULKAN_SDK/share/vulkan/icd.d/MoltenVK_icd.json \
VK_LAYER_PATH=$VULKAN_SDK/share/vulkan/explicit_layer.d \
cargo run ...
```
### [Triangle](https://github.com/MaikKlein/ash/blob/master/examples/src/bin/triangle.rs) ### [Triangle](https://github.com/MaikKlein/ash/blob/master/examples/src/bin/triangle.rs)
Displays a triangle with vertex colors. Displays a triangle with vertex colors.