Align versioning of external libraries with those used by LunarG SDK.

Load external library versions using script instead of Git submodules.
SPIRV-Cross, Vulkan-LoaderAndValidationLayers & VulkanSamples versions recorded in files.
glslang version determined by Vulkan-LoaderAndValidationLayers.
SPIRV-Tools & SPIRV-Headers versions loaded by glslang.
When MoltenVK is built as part of the LunarG SDK, use external libraries
sourced from parent Vulkan-LoaderAndValidationLayers.
Use Vulkan headers from Vulkan-LoaderAndValidationLayers.
No longer generate Vulkan specification.
Update documentation.
This commit is contained in:
Bill Hollings 2018-03-12 10:02:13 -04:00
parent b048719467
commit 00fda690ca
35 changed files with 2486 additions and 2658 deletions

8
.gitignore vendored
View File

@ -14,7 +14,13 @@ project.xcworkspace/
build/
*.[oa]
# Distribution package & Dynamic libs
# Dependencies
External/Vulkan-LoaderAndValidationLayers
External/glslang
External/SPIRV-Tools
External/SPIRV-Headers
External/SPIRV-Cross
External/VulkanSamples
# Other source repository archive directories (protects when importing)
.hg

27
.gitmodules vendored
View File

@ -1,27 +0,0 @@
[submodule "External/Vulkan-Hpp"]
path = External/Vulkan-Hpp
url = https://github.com/KhronosGroup/Vulkan-Hpp.git
ignore = dirty
[submodule "External/SPIRV-Headers"]
path = External/SPIRV-Headers
url = https://github.com/KhronosGroup/SPIRV-Headers.git
[submodule "External/SPIRV-Tools"]
path = External/SPIRV-Tools
url = https://github.com/KhronosGroup/SPIRV-Tools.git
ignore = dirty
[submodule "External/glslang"]
path = External/glslang
url = https://github.com/KhronosGroup/glslang.git
ignore = dirty
[submodule "External/SPIRV-Cross"]
path = External/SPIRV-Cross
url = https://github.com/KhronosGroup/SPIRV-Cross.git
ignore = dirty
[submodule "External/Vulkan-LoaderAndValidationLayers"]
path = External/Vulkan-LoaderAndValidationLayers
url = https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers
ignore = dirty
[submodule "External/VulkanSamples"]
path = External/VulkanSamples
url = https://github.com/brenwill/VulkanSamples.git
ignore = dirty

View File

@ -241,12 +241,6 @@ You can enable each of these extensions by defining the `VK_USE_PLATFORM_IOS_MVK
`VK_USE_PLATFORM_MACOS_MVK` guard macro in your compiler build settings. See the description
of the `mvk_vulkan.h` file below for a convenient way to enable these extensions automatically.
The *Vulkan* API, including the `VK_MVK_ios_surface` and `VK_MVK_macos_surface` surface
extensions, and other *Vulkan* extensions supported by **MoltenVK** (except `VK_MVK_moltenvk`),
is described in the
[*Vulkan 1.0 Spec with MoltenVK Extensions*](Vulkan_1.0_Spec_with_MoltenVK_Extensions.html)
document found in the `MoltenVK/Vulkan` folder of the **MoltenVK** distribution.
<a name="moltenvk_extension"></a>
### MoltenVK Extension

View File

@ -1,420 +0,0 @@
<a class="site-logo" href="https://github.com/KhronosGroup/MoltenVK" title="MoltenVK">
<img src="images/MoltenVK-Logo-Banner.png" alt="MoltenVK" style="width:256px;height:auto">
</a>
Copyright (c) 2014-2018 [The Brenwill Workshop Ltd.](http://www.brenwill.com)
*This document is written in [Markdown](http://en.wikipedia.org/wiki/Markdown) format.
For best results, use a Markdown reader.*
Table of Contents
-----------------
- *Vulkan-Hpp*
- [Using the *Vulkan-Hpp* Spec Repository with **MoltenVK**](#install_vulkan_spec)
- [Updating the *Vulkan-Hpp* library version](#update_vulkan_spec)
- *Vulkan-LoaderAndValidationLayers*
- [Using the *Vulkan-LoaderAndValidationLayers* Repository with **MoltenVK**](#install_vulkan_lvl)
- [Updating the *Vulkan-LoaderAndValidationLayers* library version](#update_vulkan_lvl)
- *VulkanSamples*
- [Using the *VulkanSamples* Repository with **MoltenVK**](#install_vulkan_samples)
- [Updating the *VulkanSamples* library version](#update_vulkan_samples)
- *SPIRV-Cross*
- [Using the *SPIRV-Cross* library with **MoltenVKShaderConverter**](#install_spirv-cross)
- [Updating the *SPIRV-Cross* library version](#update_spirv-cross)
- [Adding the *SPIRV-Cross* library to a new *Xcode* project](#add_spirv-cross)
- *SPIRV-Tools*
- [Using the *SPIRV-Tools* library with **MoltenVKShaderConverter**](#install_spirv-tools)
- [Updating the *SPIRV-Tools* library version](#update_spirv-tools)
- [Adding the *SPIRV-Tools* library to a new *Xcode* project](#add_spirv-tools)
- *glslang*
- [Using the *glslang* library with **MoltenVKShaderConverter**](#install_glslang)
- [Updating the *glslang* library version](#update_glslang)
- [Adding the *glslang* library to a new *Xcode* project](#add_glslang)
<a name="install_vulkan_spec"></a>
Using the *Vulkan-Hpp* Spec Repository with *MoltenVK*
------------------------------------------------------
**MoltenVK** uses the official *Khronos Vulkan* specification repository to provide the standard
*Vulkan* API header files and *Vulkan Specification* documentation.
To add the *Khronos Vulkan* specification repository to **MoltenVK**, open a *Terminal*
session and perform the following command-line steps:
1. Ensure you have `python3` installed:
brew install python3
2. **_Optional:_** If you want to generate a Vulkan specification document for inclusion
in the final **MoltenVK** distribution package, ensure you have `asciidoctor` installed
(you can skip this otherwise):
brew install asciidoctor
3. If you used the `--recursive` option when cloning the `MoltenVK` repository, you should already
have the `Vulkan-Hpp` submodule, and you can skip to *Step 3* below. If you did **_not_**
use the `--recursive` option when cloning the `MoltenVK` repository, retrieve the `Vulkan-Hpp`
submodule into the `External` directory as follows, from within the `MoltenVK` repository directory:
git submodule update --init --recursive External/Vulkan-Hpp
4. In the `Externals` folder within the `MoltenVK` repository, build the spec and header files
as follows from the main directory of this `MoltenVK` repository:
cd External
./makeVulkanSpec
<a name="update_vulkan_spec"></a>
Updating the *Vulkan-Hpp* library version
-----------------------------------------
If you are developing enhancements to **MoltenVK**, you can update the version of `Vulkan-Hpp`
used by **MoltenVK** to the latest version available by re-cloning and re-building the
`Vulkan-Hpp` submodule using the `getLatestVulkanSpec` script:
cd External
./getLatestVulkanSpec
The updated version will then be "locked in" the next time the `MoltenVK` repository is committed to `git`.
<a name="install_vulkan_lvl"></a>
Using the *Vulkan-LoaderAndValidationLayers* Spec Repository with *MoltenVK*
----------------------------------------------------------------------------
**MoltenVK** uses the *Khronos Vulkan Loader and Validation Layers* repository to allow **MoltenVK**
to act as an *Installable Client Driver* to support the *Vulkan Loader API*.
If you used the `--recursive` option when cloning the `MoltenVK` repository, you should already
have the `Vulkan-LoaderAndValidationLayers` submodule. If you did **_not_** use the `--recursive`
option when cloning the `MoltenVK` repository, retrieve the `Vulkan-LoaderAndValidationLayers`
submodule into the `External` directory as follows, from within the `MoltenVK` repository directory:
git submodule update --init External/Vulkan-LoaderAndValidationLayers
<a name="update_vulkan_lvl"></a>
Updating the *Vulkan-LoaderAndValidationLayers* library version
---------------------------------------------------------------
If you are developing enhancements to **MoltenVK**, you can update the version of `Vulkan-LoaderAndValidationLayers`
used by **MoltenVK** to the latest version available by re-cloning and re-building the `Vulkan-LoaderAndValidationLayers`
submodule using the `getLatestVulkanLVL` script:
cd External
./getLatestVulkanLVL
The updated version will then be "locked in" the next time the `MoltenVK` repository is committed to `git`.
<a name="install_vulkan_samples"></a>
Using the *VulkanSamples* Repository with *MoltenVK*
----------------------------------------------------
**MoltenVK** includes several simple demo apps from *LunarG*. These are sourced from
a modified fork of the *VulkanSamples* repository.
To add the *VulkanSamples* repository to **MoltenVK**, open a *Terminal* session and
perform the following command-line steps:
If you used the `--recursive` option when cloning the `MoltenVK` repository, you should already
have the `VulkanSamples` submodule. If you did **_not_** use the `--recursive` option when cloning
the `MoltenVK` repository, retrieve the `VulkanSamples` submodule into the `External` directory as
follows, from within the `MoltenVK` repository directory:
git submodule update --init External/VulkanSamples
<a name="update_vulkan_samples"></a>
Updating the *VulkanSamples* library version
--------------------------------------------
If you are developing enhancements to **MoltenVK**, you can update the version of `VulkanSamples`
used by **MoltenVK** to the latest version available by re-cloning and re-building the
`VulkanSamples` submodule using the `getLatestVulkanSamples` script:
cd External
./getLatestVulkanSamples
The updated version will then be "locked in" the next time the `MoltenVK` repository is committed to `git`.
<a name="install_spirv-cross"></a>
Using the *SPIRV-Cross* library with *MoltenVKShaderConverter*
--------------------------------------------------------------
**MoltenVKShaderConverter** uses `SPIRV-Cross` to convert *SPIR-V* code to *Metal Shading Language (MSL)* source code.
If you used the `--recursive` option when cloning the `MoltenVK` repository, you should already
have the `SPIRV-Cross` submodule. If you did **_not_** use the `--recursive` option when cloning
the `MoltenVK` repository, retrieve the `SPIRV-Cross` submodule into the `External` directory
as follows, from within the `MoltenVK` repository directory:
git submodule update --init External/SPIRV-Cross
<a name="update_spirv-cross"></a>
Updating the *SPIRV-Cross* library version
------------------------------------------
If you are developing enhancements to **MoltenVKShaderConverter**, you can update the version of
`SPIRV-Cross` used by **MoltenVKShaderConverter** to the latest version available by re-cloning
and re-building the `SPIRV-Cross` submodule using the `getLatestSPIRVCross` script:
cd External
./getLatestSPIRVCross
The updated version will then be "locked in" the next time the `MoltenVK` repository is committed to `git`.
>***Note:*** If after updating to a new verions of `SPIRV-Cross`, you encounter build errors when
building **MoltenVKShaderConverter**, review the [instructions below](#add_spirv-cross) to ensure
all necessary `SPIRV-Cross` files are included in the **MoltenVKShaderConverter** builds.
>***Note:*** As new features are added to **MoltenVK**, many are powered by the ability to convert
sophisticated *SPIRV* code into *MSL* code. Sometimes new **MoltenVK** features and capabilities are
provided solely via new `SPIRV-Cross` features. ***If you are developing enhancements for
MoltenVKShaderConverter, be sure to update the `SPIRV-Cross` submodule often***.
### Regression Testing Your Changes to *SPIRV-Cross*
If you make changes to the `SPIRV-Cross` submodule, you can regression test your changes
using the following steps:
1. Load and build the versions of `SPRIV-Tools` and `glslang` that are used by the `SPIRV-Cross` tests:
cd External/SPIRV-Cross
./checkout_glslang_spirv_tools.sh
2. Run the regression tests:
./test_shaders.sh
3. If your changes result in different expected output for a reference shader, and the new results
are correct, you can update the reference shader for a particular regression test by deleting
that reference shader, in either `External/SPIRV-Cross/reference/shaders-msl` or
`External/SPIRV-Cross/reference/opt/shaders-msl`, and running the test again. The test will
replace the deleted reference shader.
<a name="add_spirv-cross"></a>
Adding the *SPIRV-Cross* library to a new *Xcode* project
---------------------------------------------------------
The `MoltenVKShaderConverter` project is already configured to use the `SPIRV-Cross` library.
However, to add the `SPIRV-Cross` library to a new *Xcode* project:
1. Follow the [instructions above](#install_spirv-cross) to create a symlink from your project
to the location of your local clone of the `SPIRV-Cross` repository.
2. In the project navigator, add a new *Group* named `SPIRV-Cross`.
3. Add the following files from the `SPIRV-Cross` file folder to the `SPIRV-Cross`
group in the *Project Navigator* panel:
spirv_cfg.cpp
spirv_cfg.hpp
spirv_common.hpp
spirv_cross.cpp
spirv_cross.hpp
spirv_glsl.cpp
spirv_glsl.hpp
spirv_msl.cpp
spirv_msl.hpp
In the ***Choose options for adding these files*** dialog that opens, select the
***Create groups*** option, add the files to *both* the `MoltenVKSPIRVToMSLConverter-iOS`
and `MoltenVKSPIRVToMSLConverter-macOS` targets, and click the ***Finish*** button.
4. ***(Optional)*** If you want *Xcode* to reference the added files through symlinks (to increase
portability) instead of resolving them, perform the following steps:
1. **Create a backup of your project!** This is an intrusive and dangerous operation!
2. In the *Finder*, right-click your `MyApp.xcodeproj` file and select *Show Package Contents*.
3. Open the `project.pbxproj` file in a text editor.
4. Replace all occurrences of the `path-to-SPIRV-Cross-repo-folder` (as defined by the symlink added
[above](#install_spirv-cross)) with simply `SPIRV-Cross` (the name of the symlink). Be sure you only
replace the part of the path that matches the `path-to-SPIRV-Cross-repo-folder`. Do not replace
any part of the path that indicates a subfolder within that repository folder.
<a name="install_spirv-tools"></a>
Using the *SPIRV-Tools* library with *MoltenVKShaderConverter*
--------------------------------------------------------------
**MoltenVKShaderConverter** uses `SPIRV-Tools` to log *SPIR-V* code during conversion to *Metal Shading Language (MSL)*
source code. The `SPIRV-Tools` also requires the `SPIRV-Headers` library.
To add the `SPIRV-Tools` and `SPIRV-Headers` libraries to **MoltenVK**, open a *Terminal* session and
perform the following command-line steps:
1. If you used the `--recursive` option when cloning the `MoltenVK` repository, you should already
have the `SPIRV-Tools` and `SPIRV-Headers` submodules, and you can skip to *Step 2* below.
If you did **_not_** use the `--recursive` option when cloning the `MoltenVK` repository,
retrieve the `SPIRV-Tools` and `SPIRV-Headers` submodules into the `External` directory
as follows, from within the `MoltenVK` repository directory:
git submodule update --init External/SPIRV-Headers
git submodule update --init External/SPIRV-Tools
3. In the `Externals` folder within the `MoltenVK` repository, build `SPIRV-Tools`
as follows from the main directory of this `MoltenVK` repository:
cd External
./makeSPIRVTools
<a name="update_spirv-tools"></a>
Updating the *SPIRV-Tools* library version
------------------------------------------
If you are developing enhancements to **MoltenVKShaderConverter**, you can update the version of
`SPIRV-Tools` used by **MoltenVKShaderConverter** to the latest version available by re-cloning
and re-building the `SPIRV-Tools` submodule using the `getLatestSPIRVTools` script:
cd External
./getLatestSPIRVTools
The updated version will then be "locked in" the next time the `MoltenVK` repository is committed to `git`.
>***Note:*** If after updating to a new verions of `SPIRV-Tools`, you encounter build errors when
>building **MoltenVKShaderConverter**, review the [instructions below](#add_spirv-tools) to ensure
>all necessary `SPIRV-Tools` files are included in the **MoltenVKShaderConverter** builds.
<a name="add_spirv-tools"></a>
Adding the *SPIRV-Tools* library to a new *Xcode* project
---------------------------------------------------------
The `MoltenVKShaderConverter` project is already configured to use the `SPIRV-Tools` library.
However, to add the `SPIRV-Tools` library to a new *Xcode* project:
1. Follow the [instructions above](#install_spirv) to create a symlink from your project
to the location of your local clone of the `SPIRV-Tools` repository.
2. In the project navigator, add a new *Group* named `SPIRV-Tools`.
3. Drag the `SPIRV-Tools/source` folder to the `SPIRV-Tools` group in the *Project Navigator* panel.
In the _**Choose options for adding these files**_ dialog that opens, select the
_**Create groups**_ option, add the files to *both* the `MoltenVKSPIRVToMSLConverter-iOS`
and `MoltenVKSPIRVToMSLConverter-macOS` targets, and click the ***Finish*** button.
4. In the *Project Navigator* panel, select your application's target, and open the
*Build Settings* tab. Locate the build setting entry **Header Search Paths**
(`HEADER_SEARCH_PATHS`) and add the following paths:
"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Tools/include"
"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Tools/source"
"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Tools/build"
"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Headers/include"
5. ***(Optional)*** If you want *Xcode* to reference the added files through symlinks (to increase
portability) instead of resolving them, perform the following steps:
1. **Create a backup of your project!** This is an intrusive and dangerous operation!
2. In the *Finder*, right-click your `MyApp.xcodeproj` file and select *Show Package Contents*.
3. Open the `project.pbxproj` file in a text editor.
4. Replace all occurrences of the `path-to-SPIRV-Tools-repo-folder` (as defined by the symlink added
[above](#install_spirv)) with simply `SPIRV-Tools` (the name of the symlink). Be sure you only
replace the part of the path that matches the `path-to-SPIRV-Tools-repo-folder`. Do not replace
any part of the path that indicates a subfolder within that repository folder.
<a name="install_glslang"></a>
Using the *glslang* library with **MoltenVKShaderConverter**
------------------------------------------------------------
**MoltenVKShaderConverter** uses `glslang`, the Khronos *GLSL* reference compiler, to parse *GLSL* source code
and convert it to *SPIR-V*.
If you used the `--recursive` option when cloning the `MoltenVK` repository, you should already have
the `glslang` submodule. If you did **_not_** use the `--recursive` option when cloning the
`MoltenVK` repository, retrieve the `glslang` submodule into the `External` directory as follows,
from within the `MoltenVK` repository directory:
git submodule update --init External/glslang
<a name="update_glslang"></a>
Updating the *glslang* library version
--------------------------------------
If you are developing enhancements to **MoltenVKShaderConverter**, you can update the version of
`glslang` used by **MoltenVKShaderConverter** to the latest version available by re-cloning
and re-building the `glslang` submodule using the `getLatestglslang` script:
cd External
./getLatestglslang
The updated version will then be "locked in" the next time the `MoltenVK` repository is committed to `git`.
>***Note:*** If after updating to a new verions of `glslang`, you encounter build errors when
>building **MoltenVKShaderConverter**, review the [instructions below](#add_glslang) to ensure
>all necessary `glslang` files are included in the **MoltenVKShaderConverter** builds.
<a name="add_glslang"></a>
Adding the *glslang* library to a new *Xcode* project
-----------------------------------------------------
The `MoltenVKShaderConverter` project is already configured to use the `glslang` library.
However, to add the `glslang` library to a new *Xcode* project:
1. Follow the [instructions above](#install_glslang) to create a symlink from your project
to the location of your local clone of the `glslang` repository, and make the required
modifications to the `glslang` code.
2. In the project navigator, add a new *Group* named `glslang`.
3. Add the following folders from the `glslang` file folder to the `glslang` *Group* in
the *Project Navigator* panel:
glslang
OGLCompilersDLL
SPIRV
In the ***Choose options for adding these files*** dialog that opens, select the
***Create groups*** option, add the files to *both* the `MoltenVKGLSLToSPIRVConverter-iOS`
and `MoltenVKGLSLToSPIRVConverter-macOS` targets, and click the ***Finish*** button.
4. In the *Project Navigator* panel, remove the references to the following files and folders:
glslang/glslang/MachineIndependant/glslang.y
glslang/glslang/OSDependent/Windows
5. ***(Optional)*** If you want *Xcode* to reference the added files through symlinks (to increase
portability) instead of resolving them, perform the following steps:
1. **Create a backup of your project!** This is an intrusive and dangerous operation!
2. In the *Finder*, right-click your `MyApp.xcodeproj` file and select *Show Package Contents*.
3. Open the `project.pbxproj` file in a text editor.
4. Replace all occurrences of the `path-to-glslang-repo-folder` (as defined by the symlink added
[above](#install_glslang)) with simply `glslang` (the name of the symlink). Be sure you only
replace the part of the path that matches the `path-to-glslang-repo-folder`. Do not replace
any part of the path that indicates a subfolder within that repository folder.

View File

@ -1 +0,0 @@
../MoltenVK/Vulkan-Hpp/Vulkan-Docs/out/1.0/html/vkspec.html

230
External/README.md vendored Normal file
View File

@ -0,0 +1,230 @@
<a class="site-logo" href="https://github.com/KhronosGroup/MoltenVK" title="MoltenVK">
<img src="../Docs/images/MoltenVK-Logo-Banner.png" alt="MoltenVK" style="width:256px;height:auto">
</a>
#MoltenVK External Dependencies
Copyright (c) 2014-2018 [The Brenwill Workshop Ltd.](http://www.brenwill.com)
*This document is written in [Markdown](http://en.wikipedia.org/wiki/Markdown) format.
For best results, use a Markdown reader.*
Table of Contents
-----------------
- [Fetching External Libraries](#fetching)
- [Updating External Library Versions](#updating)
- [Adding the *SPIRV-Cross* Library to the *MoltenVKShaderConverter Xcode* Project](#add_spirv-cross)
- [Adding the *SPIRV-Tools* Library to the *MoltenVKShaderConverter Xcode* Project](#add_spirv-tools)
- [Adding the *glslang* Library to the *MoltenVKShaderConverter Xcode* Project](#add_glslang)
<a name="fetching"></a>
Fetching External Libraries
---------------------------
**MoltenVK** uses technology from the following external open-source libraries:
- [*SPIRV-Cross*](https://github.com/KhronosGroup/SPIRV-Cross)
- [*Vulkan-LoaderAndValidationLayers*](https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers)
- [*glslang*](https://github.com/KhronosGroup/glslang)
- [*SPIRV-Tools*](https://github.com/KhronosGroup/SPIRV-Tools)
- [*SPIRV-Headers*](https://github.com/KhronosGroup/SPIRV-Headers)
- [*VulkanSamples*](https://github.com/brenwill/VulkanSamples)
These external open-source libraries are maintained in the `External` directory.
To retrieve these libraries from their sources, run the `fetchDependencies`
script in that directory:
cd External
./fetchDependencies [-sdk]
The `-sdk` option tells the script that **MoltenVK** is being installed as part of
the *LunarG Vulkan SDK*, and that **MoltenVK** can find some of the required libraries
already loaded in the SDK, instead of retrieving them from their repositories again.
If you are using **MoltenVK** outside of the *LunarG Vulkan SDK*, do not use the `-sdk`
option, so that all of the required external libraries will be retrieved.
<a name="updating"></a>
Updating External Library Versions
----------------------------------
To maintain consistency between the libraries, **MoltenVK** retrieves specific
versions of each external library. The version of each external library is
determined as follows:
- **_SPIRV-Cross_**: a GitHub repository commit identifier found in the
`External/SPIRV-Cross_repo_revision` file.
- **_VulkanSamples_**: a GitHub repository commit identifier found in the
`External/VulkanSamples_repo_revision` file.
- **_Vulkan-LoaderAndValidationLayers_**: a GitHub repository commit identifier found
in the `External/Vulkan-LoaderAndValidationLayers_repo_revision` file.
- **_glslang_**: a GitHub repository commit identifier found in the retrieved
*Vulkan-LoaderAndValidationLayers* repository.
- **_SPIRV-Tools_**: automatically retrieved by the *glslang* repository.
- **_SPIRV-Headers_**: automatically retrieved by the *glslang* repository.
You can update which version of the *SPIRV-Cross*, *VulkanSamples*, and
*Vulkan-LoaderAndValidationLayers* libraries are retrieved, by changing the
value held in the corresponding `*_repo_revision` file listed above.
The version of the *glslang*, *SPIRV-Tools*, and *SPIRV-Headers* libraries is
automatically determined by the version of the *Vulkan-LoaderAndValidationLayers*
library you have retrieved.
Once you have made changes, you can retrieve the updated library versions by running
the `fetchDependencies` script again.
>***Note:*** If, after updating to new verions of the external libraries, you encounter
>build errors when building **MoltenVK**, review the instructions in the sections below
>to ensure all necessary external library files are included in the **MoltenVK** builds.
<a name="add_spirv-cross"></a>
Adding the *SPIRV-Cross* Library to the *MoltenVKShaderConverter Xcode* Project
-------------------------------------------------------------------------------
The `MoltenVKShaderConverter` *Xcode* project is already configured to use the *SPIRV-Cross*
library. However, after updating the version of *SPIRV-Cross*, as described [above](#updating),
if you encounter any linking errors, may need to re-add the *SPIRV-Cross* library to the
`MoltenVKShaderConverter` *Xcode* project as follows:
1. In the *Project Navigator*, remove all of the files under the *Group* named
`MoltenVKSPIRVToMSLConverter/SPIRV-Cross`.
2. Add the following files from the `SPIRV-Cross` file folder to the `SPIRV-Cross`
group in the *Project Navigator* panel:
spirv_cfg.cpp
spirv_cfg.hpp
spirv_common.hpp
spirv_cross.cpp
spirv_cross.hpp
spirv_glsl.cpp
spirv_glsl.hpp
spirv_msl.cpp
spirv_msl.hpp
In the ***Choose options for adding these files*** dialog that opens, select the
***Create groups*** option, add the files to *both* the `MoltenVKSPIRVToMSLConverter-iOS`
and `MoltenVKSPIRVToMSLConverter-macOS` targets, and click the ***Finish*** button.
3. ***(Optional)*** To simplify the paths used within *Xcode* to reference the added files,
perform the following steps:
1. **Create a backup of your project!** This is an intrusive and dangerous operation!
2. In the *Finder*, right-click your `MoltenVKShaderConverter.xcodeproj` file and select
**_Show Package Contents_**.
3. Open the `project.pbxproj` file in a text editor.
4. Replace all occurrences of the `path-to-SPIRV-Cross-repo-folder` with simply
`SPIRV-Cross`.
### Regression Testing Your Changes to *SPIRV-Cross*
If you make changes to the `SPIRV-Cross` repository, you can regression test your changes
using the following steps:
1. Load and build the versions of `SPRIV-Tools` and `glslang` that are used by the `SPIRV-Cross` tests:
cd External/SPIRV-Cross
./checkout_glslang_spirv_tools.sh
2. Run the regression tests:
./test_shaders.sh
3. If your changes result in different expected output for a reference shader, and the new results
are correct, you can update the reference shader for a particular regression test by deleting
that reference shader, in either `External/SPIRV-Cross/reference/shaders-msl` or
`External/SPIRV-Cross/reference/opt/shaders-msl`, and running the test again. The test will
replace the deleted reference shader.
<a name="add_spirv-tools"></a>
Adding the *SPIRV-Tools* Library to the *MoltenVKShaderConverter Xcode* Project
-------------------------------------------------------------------------------
The `MoltenVKShaderConverter` *Xcode* project is already configured to use the *SPIRV-Tools*
library. However, after updating the version of *SPIRV-Tools*, as described [above](#updating),
if you encounter any linking errors, may need to re-add the *SPIRV-Tools* library to the
`MoltenVKShaderConverter` *Xcode* project as follows:
1. In the *Project Navigator*, remove the *Group* named `source` from under the *Group* named
`MoltenVKSPIRVToMSLConverter/SPIRV-Tools`.
2. Drag the `SPIRV-Tools/source` file folder to the `SPIRV-Tools` group in the *Project Navigator* panel.
In the _**Choose options for adding these files**_ dialog that opens, select the
_**Create groups**_ option, add the files to *both* the `MoltenVKSPIRVToMSLConverter-iOS`
and `MoltenVKSPIRVToMSLConverter-macOS` targets, and click the ***Finish*** button.
3. In the *Project Navigator* panel, select your application's target, and open the
*Build Settings* tab. Locate the build setting entry **Header Search Paths**
(`HEADER_SEARCH_PATHS`) and add the following paths:
"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Tools/include"
"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Tools/source"
"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Tools/build"
"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Headers/include"
5. ***(Optional)*** To simplify the paths used within *Xcode* to reference the added files,
perform the following steps:
1. **Create a backup of your project!** This is an intrusive and dangerous operation!
2. In the *Finder*, right-click your `MoltenVKShaderConverter.xcodeproj` file and select
**_Show Package Contents_**.
3. Open the `project.pbxproj` file in a text editor.
4. Replace all occurrences of the `path-to-SPIRV-Tools-repo-folder/source` with simply `source`.
<a name="add_glslang"></a>
Adding the *glslang* Library to the *MoltenVKShaderConverter Xcode* Project
---------------------------------------------------------------------------
The `MoltenVKShaderConverter` *Xcode* project is already configured to use the *glslang*
library. However, after updating the version of *glslang*, as described [above](#updating),
if you encounter any linking errors, may need to re-add the *glslang* library to the
`MoltenVKShaderConverter` *Xcode* project as follows:
1. In the *Project Navigator*, remove all *Groups* from under the *Group* named
`MoltenVKGLSLToSPIRVConverter/glslang`.
2. Add the following folders from the `glslang` file folder to the `glslang` *Group* in
the *Project Navigator* panel:
glslang
OGLCompilersDLL
SPIRV
In the ***Choose options for adding these files*** dialog that opens, select the
***Create groups*** option, add the files to *both* the `MoltenVKGLSLToSPIRVConverter-iOS`
and `MoltenVKGLSLToSPIRVConverter-macOS` targets, and click the ***Finish*** button.
3. In the *Project Navigator* panel, remove the references to the following files and folders:
glslang/glslang/MachineIndependant/glslang.y
glslang/glslang/OSDependent/Windows
4. ***(Optional)*** To simplify the paths used within *Xcode* to reference the added files,
perform the following steps:
1. **Create a backup of your project!** This is an intrusive and dangerous operation!
2. In the *Finder*, right-click your `MoltenVKShaderConverter.xcodeproj` file and select
**_Show Package Contents_**.
3. Open the `project.pbxproj` file in a text editor.
4. Replace all occurrences of the `path-to-glslang-repo-folder` with simply `glslang `.

@ -1 +0,0 @@
Subproject commit 50ef6cd95fa2d22f31dc8cb5e22a7cf1094c017e

1
External/SPIRV-Cross_repo_revision vendored Normal file
View File

@ -0,0 +1 @@
0f9cb0da0d5ab91b21a42ffc0062840fc76e81e3

@ -1 +0,0 @@
Subproject commit 98b01515724c428d0f0a5d01deffcce0f5f5e61c

@ -1 +0,0 @@
Subproject commit 1acce99255ee28a582776372593e91b585d3c011

1
External/Vulkan-Hpp vendored

@ -1 +0,0 @@
Subproject commit 82a14093cfb3f11da82d3b080ab650ce36a5ba13

@ -1 +0,0 @@
Subproject commit eb59198227debc125069ad9a008a1b17cefd564f

View File

@ -0,0 +1 @@
6d3938172cba2d9235f258efa1db1c16443c66c6

@ -1 +0,0 @@
Subproject commit d435e00dc9f614155621cdadd2f00fbd0585cda6

1
External/VulkanSamples_repo_revision vendored Normal file
View File

@ -0,0 +1 @@
d435e00dc9f614155621cdadd2f00fbd0585cda6

126
External/fetchDependencies vendored Executable file
View File

@ -0,0 +1,126 @@
#!/usr/bin/env bash
#
# Copyright (c) 2016-2018 The Brenwill Workshop Ltd.
#
# fetchDependencies - Retrieves the correct versions of all dependencies
#
# macOS usage: ./fetchDependencies [-sdk]
#
# -sdk = Load for the LunarG SDK, using symlinks to repos in SDK instead of fetching
# Vulkan-LoaderAndValidationLayers and glslang repositories.
# ----------------- Functions -------------------
# Clone a repository
# $1 repo name
# $2 repo url
# $3 repo revision (commit SHA)
clone_repo() {
echo "$1 repo: $2"
echo "$1 revision: $3"
rm -rf $1
git clone $2 $1
cd $1
git checkout $3
cd -
}
# Build a repository
# $1 repo name
build_repo() {
echo "Building $1"
rm -rf $1/build
mkdir $1/build
cd $1/build
cmake ..
make
cd -
}
echo
echo Retrieving MoltenVK dependencies.
echo
V_LVL_NAME=Vulkan-LoaderAndValidationLayers
GLSLANG_NAME=glslang
SPIRV_TOOLS_NAME=SPIRV-Tools
# ----------------- SPIRV-Cross -------------------
REPO_NAME=SPIRV-Cross
REPO_URL="https://github.com/KhronosGroup/${REPO_NAME}.git"
REPO_REV=$(cat "./${REPO_NAME}_repo_revision")
clone_repo ${REPO_NAME} ${REPO_URL} ${REPO_REV}
# ----------------- VulkanSamples -------------------
REPO_NAME=VulkanSamples
REPO_URL="https://github.com/brenwill/${REPO_NAME}.git"
REPO_REV=$(cat "./${REPO_NAME}_repo_revision")
clone_repo ${REPO_NAME} ${REPO_URL} ${REPO_REV}
# ----------------- SPIRV-Tools -------------------
REPO_NAME=${SPIRV_TOOLS_NAME}
rm -rf ${REPO_NAME}
ln -sfn ${GLSLANG_NAME}/External/spirv-tools ${REPO_NAME}
# ----------------- SPIRV-Headers -------------------
REPO_NAME=SPIRV-Headers
rm -rf ${REPO_NAME}
ln -sfn ${SPIRV_TOOLS_NAME}/external/spirv-headers ${REPO_NAME}
# ----------------- Vulkan-LoaderAndValidationLayers, glslang, SPIRV-Tools & SPIRV-Headers -------------------
# When MoltenVK is loaded as a dependency of the LunarG SDK, the LunarG SDK already
# has Vulkan-LoaderAndValidationLayers & glslang, so create simlinks instead.
if [ "$1" = "-sdk" ]; then
REPO_NAME=${V_LVL_NAME}
rm -rf ${REPO_NAME}
ln -sfn ../../.. ${REPO_NAME}
REPO_NAME=${GLSLANG_NAME}
rm -rf ${REPO_NAME}
ln -sfn ../../${REPO_NAME} ${REPO_NAME}
else
# ----------------- Vulkan-LoaderAndValidationLayers -------------------
REPO_NAME=${V_LVL_NAME}
REPO_URL="https://github.com/KhronosGroup/${REPO_NAME}.git"
REPO_REV=$(cat "./${REPO_NAME}_repo_revision")
clone_repo ${REPO_NAME} ${REPO_URL} ${REPO_REV}
# ----------------- glslang, SPIRV-Tools & SPIRV-Headers ---------------
REPO_NAME=${GLSLANG_NAME}
REPO_URL=$(cat "${V_LVL_NAME}/external_revisions/glslang_giturl")
REPO_REV=$(cat "${V_LVL_NAME}/external_revisions/glslang_revision")
clone_repo ${REPO_NAME} ${REPO_URL} ${REPO_REV}
cd ${REPO_NAME}
./update_glslang_sources.py
cd -
build_repo ${GLSLANG_NAME}
build_repo ${SPIRV_TOOLS_NAME}
fi

22
External/getLatestAll vendored
View File

@ -1,22 +0,0 @@
#!/usr/bin/env bash
#
# Copyright (c) 2016-2018 The Brenwill Workshop Ltd.
#
# getLatestAll - Updates to the latest versions of all submodules.
#
# Invokes the following scripts:
# getLatestVulkanSpec
# getLatestSPIRVTools
# getLatestglslang
# getLatestSPIRVCross
# getLatestVulkanLVL
# getLatestVulkanSamples
#
# macOS usage: ./getLatestAll
./getLatestVulkanSpec
./getLatestSPIRVTools
./getLatestglslang
./getLatestSPIRVCross
./getLatestVulkanLVL
./getLatestVulkanSamples

View File

@ -1,10 +0,0 @@
#!/usr/bin/env bash
#
# Copyright (c) 2016-2018 The Brenwill Workshop Ltd.
#
# getLatestSPIRVCross - Updates to the latest version of SPIRV-Cross submodule.
#
# macOS usage: ./getLatestSPIRVCross
rm -rf SPIRV-Cross
git clone https://github.com/KhronosGroup/SPIRV-Cross.git

View File

@ -1,15 +0,0 @@
#!/usr/bin/env bash
#
# Copyright (c) 2016-2018 The Brenwill Workshop Ltd.
#
# getLatestSPIRVTools - Updates to the latest version of SPIRV-Tools submodule.
#
# macOS usage: ./getLatestSPIRVTools
rm -rf SPIRV-Headers
git clone https://github.com/KhronosGroup/SPIRV-Headers.git
rm -rf SPIRV-Tools
git clone https://github.com/KhronosGroup/SPIRV-Tools.git
./makeSPIRVTools

View File

@ -1,10 +0,0 @@
#!/usr/bin/env bash
#
# Copyright (c) 2016-2018 The Brenwill Workshop Ltd.
#
# getLatestVulkanLVL - Updates to the latest version of Vulkan-LoaderAndValidationLayers submodule.
#
# macOS usage: ./getLatestVulkanLVL
rm -rf Vulkan-LoaderAndValidationLayers
git clone https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers.git

View File

@ -1,11 +0,0 @@
#!/usr/bin/env bash
#
# Copyright (c) 2016-2018 The Brenwill Workshop Ltd.
#
# getLatestVulkanSamples - Updates to the latest version of VulkanSamples submodule.
#
# macOS usage: ./getLatestVulkanSamples
rm -rf VulkanSamples
git clone https://github.com/brenwill/VulkanSamples.git

View File

@ -1,11 +0,0 @@
#!/usr/bin/env bash
#
# Copyright (c) 2016-2018 The Brenwill Workshop Ltd.
#
# getLatestVulkanSpec - Updates to the latest version of the Vulkan spec submodule.
#
# macOS usage: ./getLatestVulkanSpec
rm -rf Vulkan-Hpp
git clone --recursive https://github.com/KhronosGroup/Vulkan-Hpp.git
./makeVulkanSpec

View File

@ -1,11 +0,0 @@
#!/usr/bin/env bash
#
# Copyright (c) 2016-2018 The Brenwill Workshop Ltd.
#
# getLatestglslang - Updates to the latest version of glslang submodule.
#
# macOS usage: ./getLatestglslang
rm -rf glslang
git clone https://github.com/KhronosGroup/glslang.git
./makeglslang

1
External/glslang vendored

@ -1 +0,0 @@
Subproject commit 046bae0babd17ecc19fc7cbe40c35aa13ac2ee65

15
External/makeAll vendored
View File

@ -1,15 +0,0 @@
#!/usr/bin/env bash
#
# Copyright (c) 2016-2018 The Brenwill Workshop Ltd.
#
# makeAll - invokes the following scripts
# makeVulkanSpec
# makeSPIRVTools
# makeglslang
#
# macOS usage: ./makeAll
./makeVulkanSpec
./makeSPIRVTools
./makeglslang

View File

@ -1,19 +0,0 @@
#!/usr/bin/env bash
#
# Copyright (c) 2016-2018 The Brenwill Workshop Ltd.
#
# makeSPIRVTools - build SPIRV-Tools
#
# macOS usage: ./makeSPIRVTools
echo
echo MoltenVK building SPIRV-Tools
echo
ln -sfn ../../SPIRV-Headers SPIRV-Tools/external/SPIRV-Headers
rm -rf SPIRV-Tools/build
mkdir SPIRV-Tools/build
cd SPIRV-Tools/build
cmake ..
make
cd -

View File

@ -1,36 +0,0 @@
#!/usr/bin/env bash
#
# Copyright (c) 2016-2018 The Brenwill Workshop Ltd.
#
# makeVulkanSpec - invoke Makefile with the right options to build:
# vulkan.h
# vkspec.html
# with all MoltenVK extensions included.
#
# macOS usage: ./makeVulkanSpec
MVK_EXTS="VK_KHR_swapchain VK_KHR_surface VK_MVK_ios_surface VK_MVK_macos_surface VK_IMG_format_pvrtc VK_AMD_negative_viewport_height"
# Generate vulkan.hpp and consolidate all header files
echo
echo MoltenVK building vulkan.h
echo
cd Vulkan-Hpp
cmake .
make
./VulkanHppGenerator
cp Vulkan-Docs/src/vulkan/*.h vulkan
cd -
# Generate the Vulkan Spec document
echo
echo MoltenVK building Vulkan spec document
echo
cd Vulkan-Hpp/Vulkan-Docs/doc/specs/vulkan
make clean_generated
make EXTENSIONS="$MVK_EXTS" APITITLE="(with extensions supported by MoltenVK)" html
cd -

18
External/makeglslang vendored
View File

@ -1,18 +0,0 @@
#!/usr/bin/env bash
#
# Copyright (c) 2016-2018 The Brenwill Workshop Ltd.
#
# makeglslang - build glslangValidator for (used by SPIRV-Cross regression tests)
#
# macOS usage: ./makeglslang
echo
echo MoltenVK building glslang
echo
rm -rf glslang/build
mkdir glslang/build
cd glslang/build
cmake ..
make
cd -

View File

@ -13,8 +13,6 @@
A90C8DEB1F45354D009CB32C /* MVKCommandEncodingPool.h in Headers */ = {isa = PBXBuildFile; fileRef = A90C8DE81F45354D009CB32C /* MVKCommandEncodingPool.h */; };
A90C8DEC1F45354D009CB32C /* MVKCommandEncodingPool.mm in Sources */ = {isa = PBXBuildFile; fileRef = A90C8DE91F45354D009CB32C /* MVKCommandEncodingPool.mm */; };
A90C8DED1F45354D009CB32C /* MVKCommandEncodingPool.mm in Sources */ = {isa = PBXBuildFile; fileRef = A90C8DE91F45354D009CB32C /* MVKCommandEncodingPool.mm */; };
A91416171D061EEF00524589 /* vulkan in Headers */ = {isa = PBXBuildFile; fileRef = A9AC84391D061E9F00E2CA97 /* vulkan */; settings = {ATTRIBUTES = (Public, ); }; };
A914161B1D061EFB00524589 /* vulkan in Headers */ = {isa = PBXBuildFile; fileRef = A9AC84391D061E9F00E2CA97 /* vulkan */; settings = {ATTRIBUTES = (Public, ); }; };
A948BB7F1E51642700DE59F2 /* mvk_vulkan.h in Headers */ = {isa = PBXBuildFile; fileRef = A948BB7E1E51642700DE59F2 /* mvk_vulkan.h */; settings = {ATTRIBUTES = (Public, ); }; };
A948BB801E51642700DE59F2 /* mvk_vulkan.h in Headers */ = {isa = PBXBuildFile; fileRef = A948BB7E1E51642700DE59F2 /* mvk_vulkan.h */; settings = {ATTRIBUTES = (Public, ); }; };
A94FB7B01C7DFB4800632CA3 /* mvk_datatypes.h in Headers */ = {isa = PBXBuildFile; fileRef = A94FB7671C7DFB4800632CA3 /* mvk_datatypes.h */; settings = {ATTRIBUTES = (Public, ); }; };
@ -308,7 +306,7 @@
A981494B1FB6A3F7005F00B4 /* MVKWatermarkShaderSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVKWatermarkShaderSource.h; sourceTree = "<group>"; };
A981494C1FB6A3F7005F00B4 /* MVKWatermarkTextureContent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVKWatermarkTextureContent.h; sourceTree = "<group>"; };
A981496A1FB6A998005F00B4 /* MVKStrings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVKStrings.h; sourceTree = "<group>"; };
A9AC84391D061E9F00E2CA97 /* vulkan */ = {isa = PBXFileReference; lastKnownFileType = folder; name = vulkan; path = "Vulkan-Hpp/Vulkan-Docs/src/vulkan"; sourceTree = "<group>"; };
A9AD67C72054DD6C00ED3C08 /* vulkan */ = {isa = PBXFileReference; lastKnownFileType = folder; path = vulkan; sourceTree = "<group>"; };
A9B8EE0A1A98D796009C5A02 /* MoltenVK.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MoltenVK.framework; sourceTree = BUILT_PRODUCTS_DIR; };
A9C86CB61C55B8350096CAF2 /* MoltenVKShaderConverter.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = MoltenVKShaderConverter.xcodeproj; path = ../MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj; sourceTree = "<group>"; };
A9C96DCE1DDC20C20053187F /* MVKMTLBufferAllocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVKMTLBufferAllocation.h; sourceTree = "<group>"; };
@ -490,9 +488,9 @@
A9AC84381D061E7000E2CA97 /* include */ = {
isa = PBXGroup;
children = (
A9AC84391D061E9F00E2CA97 /* vulkan */,
A9AD67C72054DD6C00ED3C08 /* vulkan */,
);
name = include;
path = include;
sourceTree = "<group>";
};
A9F0429B1FB4CF82009FCCB8 /* Common */ = {
@ -538,7 +536,6 @@
A94FB7B01C7DFB4800632CA3 /* mvk_datatypes.h in Headers */,
A98149511FB6A3F7005F00B4 /* MVKEnvironment.h in Headers */,
A948BB7F1E51642700DE59F2 /* mvk_vulkan.h in Headers */,
A91416171D061EEF00524589 /* vulkan in Headers */,
A94FB8101C7DFB4800632CA3 /* MVKSurface.h in Headers */,
A94FB7F41C7DFB4800632CA3 /* MVKInstance.h in Headers */,
A95870F81C90D29F009EB096 /* MVKCommandResourceFactory.h in Headers */,
@ -591,7 +588,6 @@
A94FB7B11C7DFB4800632CA3 /* mvk_datatypes.h in Headers */,
A98149521FB6A3F7005F00B4 /* MVKEnvironment.h in Headers */,
A948BB801E51642700DE59F2 /* mvk_vulkan.h in Headers */,
A914161B1D061EFB00524589 /* vulkan in Headers */,
A94FB8111C7DFB4800632CA3 /* MVKSurface.h in Headers */,
A94FB7F51C7DFB4800632CA3 /* MVKInstance.h in Headers */,
A95870F91C90D29F009EB096 /* MVKCommandResourceFactory.h in Headers */,
@ -972,7 +968,6 @@
GENERATE_MASTER_OBJECT_FILE = YES;
HEADER_SEARCH_PATHS = (
"\"$(SRCROOT)/include\"",
"\"$(SRCROOT)/../External/Vulkan-LoaderAndValidationLayers/include\"",
"\"$(SRCROOT)/../MoltenVKShaderConverter\"",
);
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
@ -1030,7 +1025,6 @@
GENERATE_MASTER_OBJECT_FILE = YES;
HEADER_SEARCH_PATHS = (
"\"$(SRCROOT)/include\"",
"\"$(SRCROOT)/../External/Vulkan-LoaderAndValidationLayers/include\"",
"\"$(SRCROOT)/../MoltenVKShaderConverter\"",
);
IPHONEOS_DEPLOYMENT_TARGET = 9.0;

View File

@ -1 +0,0 @@
../External/Vulkan-Hpp

View File

@ -1 +1 @@
../../External/Vulkan-Hpp/vulkan
../../External/Vulkan-LoaderAndValidationLayers/include/vulkan/

View File

@ -132,24 +132,17 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
A9077A4F1FF2D17700BE1757 /* ThirdPartyConfig.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = ThirdPartyConfig.md; path = Docs/ThirdPartyConfig.md; sourceTree = "<group>"; };
A92DB3E41CE0F37D00FBC835 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
A92DB3E51CE0F37D00FBC835 /* LICENSE */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
A92DB3E61CE0F37D00FBC835 /* Whats_New.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = Whats_New.md; path = Docs/Whats_New.md; sourceTree = "<group>"; };
A92DB3EE1CE0F72500FBC835 /* MoltenVK.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = MoltenVK.xcodeproj; path = MoltenVK/MoltenVK.xcodeproj; sourceTree = "<group>"; };
A92DB40E1CE0F89600FBC835 /* MoltenVKShaderConverter.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = MoltenVKShaderConverter.xcodeproj; path = MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj; sourceTree = "<group>"; };
A939A6FC1F547A12006ACA0C /* makeAll */ = {isa = PBXFileReference; lastKnownFileType = text; path = makeAll; sourceTree = "<group>"; };
A939A6FD1F547A12006ACA0C /* makeglslang */ = {isa = PBXFileReference; lastKnownFileType = text; path = makeglslang; sourceTree = "<group>"; };
A939A6FE1F547A12006ACA0C /* makeSPIRVTools */ = {isa = PBXFileReference; lastKnownFileType = text; path = makeSPIRVTools; sourceTree = "<group>"; };
A939A6FF1F547A12006ACA0C /* makeVulkanSpec */ = {isa = PBXFileReference; lastKnownFileType = text; path = makeVulkanSpec; sourceTree = "<group>"; };
A94545691FEB1C23000C2CB2 /* getLatestVulkanLVL */ = {isa = PBXFileReference; lastKnownFileType = text; path = getLatestVulkanLVL; sourceTree = "<group>"; };
A943100220546CDD00F5CF87 /* fetchDependencies */ = {isa = PBXFileReference; lastKnownFileType = text; path = fetchDependencies; sourceTree = "<group>"; };
A98149E51FB78829005F00B4 /* MoltenVK_Runtime_UserGuide.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = MoltenVK_Runtime_UserGuide.md; path = Docs/MoltenVK_Runtime_UserGuide.md; sourceTree = "<group>"; };
A9B732A31FC9C588006721CB /* getLatestglslang */ = {isa = PBXFileReference; lastKnownFileType = text; path = getLatestglslang; sourceTree = "<group>"; };
A9B732A41FC9C588006721CB /* getLatestSPIRVTools */ = {isa = PBXFileReference; lastKnownFileType = text; path = getLatestSPIRVTools; sourceTree = "<group>"; };
A9B732A51FC9C588006721CB /* getLatestSPIRVCross */ = {isa = PBXFileReference; lastKnownFileType = text; path = getLatestSPIRVCross; sourceTree = "<group>"; };
A9B732A61FC9C588006721CB /* getLatestVulkanSpec */ = {isa = PBXFileReference; lastKnownFileType = text; path = getLatestVulkanSpec; sourceTree = "<group>"; };
A9B732A71FCA1D71006721CB /* getLatestAll */ = {isa = PBXFileReference; lastKnownFileType = text; path = getLatestAll; sourceTree = "<group>"; };
A9CE6DAB204DF924005250D7 /* getLatestVulkanSamples */ = {isa = PBXFileReference; lastKnownFileType = text; path = getLatestVulkanSamples; sourceTree = "<group>"; };
A9AD67D12054E2D700ED3C08 /* VulkanSamples_repo_revision */ = {isa = PBXFileReference; lastKnownFileType = text; path = VulkanSamples_repo_revision; sourceTree = "<group>"; };
A9AD67D22054E2D700ED3C08 /* Vulkan-LoaderAndValidationLayers_repo_revision */ = {isa = PBXFileReference; lastKnownFileType = text; path = "Vulkan-LoaderAndValidationLayers_repo_revision"; sourceTree = "<group>"; };
A9AD67D32054E2D700ED3C08 /* SPIRV-Cross_repo_revision */ = {isa = PBXFileReference; lastKnownFileType = text; path = "SPIRV-Cross_repo_revision"; sourceTree = "<group>"; };
A9AD67E92055D8A600ED3C08 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXGroup section */
@ -169,7 +162,6 @@
A92DB3E41CE0F37D00FBC835 /* README.md */,
A92DB3E51CE0F37D00FBC835 /* LICENSE */,
A98149E51FB78829005F00B4 /* MoltenVK_Runtime_UserGuide.md */,
A9077A4F1FF2D17700BE1757 /* ThirdPartyConfig.md */,
A92DB3E61CE0F37D00FBC835 /* Whats_New.md */,
);
name = Docs;
@ -187,17 +179,11 @@
A939A6FB1F5479D0006ACA0C /* External */ = {
isa = PBXGroup;
children = (
A939A6FC1F547A12006ACA0C /* makeAll */,
A939A6FD1F547A12006ACA0C /* makeglslang */,
A939A6FE1F547A12006ACA0C /* makeSPIRVTools */,
A939A6FF1F547A12006ACA0C /* makeVulkanSpec */,
A9B732A71FCA1D71006721CB /* getLatestAll */,
A9B732A31FC9C588006721CB /* getLatestglslang */,
A9B732A51FC9C588006721CB /* getLatestSPIRVCross */,
A9B732A41FC9C588006721CB /* getLatestSPIRVTools */,
A94545691FEB1C23000C2CB2 /* getLatestVulkanLVL */,
A9CE6DAB204DF924005250D7 /* getLatestVulkanSamples */,
A9B732A61FC9C588006721CB /* getLatestVulkanSpec */,
A9AD67E92055D8A600ED3C08 /* README.md */,
A943100220546CDD00F5CF87 /* fetchDependencies */,
A9AD67D32054E2D700ED3C08 /* SPIRV-Cross_repo_revision */,
A9AD67D22054E2D700ED3C08 /* Vulkan-LoaderAndValidationLayers_repo_revision */,
A9AD67D12054E2D700ED3C08 /* VulkanSamples_repo_revision */,
);
path = External;
sourceTree = "<group>";
@ -318,7 +304,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -e\n\n# Package folder\nexport MVK_WKSPC_PATH=\"${PROJECT_DIR}\"\nexport MVK_PKG_LOCN=\"${MVK_WKSPC_PATH}/Package\"\nexport MVK_PKG_CONFIG_PATH=\"${MVK_PKG_LOCN}/${CONFIGURATION}\"\n\n# Copy the docs. Allow silent fail if a symlinked doc is not built.\ncp -a \"${MVK_WKSPC_PATH}/LICENSE\" \"${MVK_PKG_CONFIG_PATH}\"\ncp -pRLf \"${MVK_WKSPC_PATH}/Docs\" \"${MVK_PKG_CONFIG_PATH}\" 2> /dev/null || true\nrm \"${MVK_PKG_CONFIG_PATH}/Docs/ThirdPartyConfig.md\"\n\n";
shellScript = "set -e\n\n# Package folder\nexport MVK_WKSPC_PATH=\"${PROJECT_DIR}\"\nexport MVK_PKG_LOCN=\"${MVK_WKSPC_PATH}/Package\"\nexport MVK_PKG_CONFIG_PATH=\"${MVK_PKG_LOCN}/${CONFIGURATION}\"\n\n# Copy the docs. Allow silent fail if a symlinked doc is not built.\ncp -a \"${MVK_WKSPC_PATH}/LICENSE\" \"${MVK_PKG_CONFIG_PATH}\"\ncp -pRLf \"${MVK_WKSPC_PATH}/Docs\" \"${MVK_PKG_CONFIG_PATH}\" 2> /dev/null || true\n";
};
A9FEADD61F3517480010240E /* Package MoltenVK */ = {
isa = PBXShellScriptBuildPhase;

View File

@ -21,7 +21,7 @@
#include "SPIRVToMSLConverter.h"
#include "MVKStrings.h"
#include "GlslangToSpv.h"
#include "disassemble.h"
#include "glslang/SPIRV/disassemble.h"
#include "doc.h"
#include <sstream>

View File

@ -20,14 +20,11 @@ Table of Contents
- [About This Document](#about_this)
- [Introduction](#intro)
- [Installing **MoltenVK**](#install)
- [Third-Party Libraries](#third-party)
- [Updating the Third-Party Library Versions](#update_third-party)
- [Building **MoltenVK**](#building)
- [Running the **MoltenVK** Demo Applications](#demos)
- [Using **MoltenVK** in Your Application](#using)
- [**MoltenVK** and *Vulkan* Compliance](#compliance)
- [Contributing to **MoltenVK** Development](#contributing)
- [Third-Party Credits](#credits)
@ -66,81 +63,32 @@ Introduction
Installing **MoltenVK**
-----------------------
**MoltenVK** relies on several third-party open-source libraries, which are described in the
[next section](#third-party). The easiest way to install **MoltenVK** is to recursively clone
this `MoltenVK` repository, and then run the `External/makeAll` script to create necessary
components within the third-party libraries.
To install **MoltenVK**, clone this `MoltenVK` repository, and then run the
`External/fetchDependencies` script to retrieve and build several external
open-source libraries on which **MoltenVK** relies:
1. Ensure you have `cmake` and `python3` installed:
brew install cmake
brew install python3
2. **_Optional:_** If you want to generate a Vulkan specification document for inclusion
in the final **MoltenVK** distribution package, ensure you have `asciidoctor` installed
(you can skip this otherwise):
2. Clone the `MoltenVK` repository:
brew install asciidoctor
git clone https://github.com/KhronosGroup/MoltenVK.git
3. Recursively clone the `MoltenVK` repository:
git clone --recursive https://github.com/KhronosGroup/MoltenVK.git
4. Run the third-party build script:
3. Retrieve and build the external libraries:
cd MoltenVK/External
./makeAll
See the [next section](#third-party) for more information about the third-party libraries,
and how to work with them within the **MoltenVK** development environment.
<a name="third-party"></a>
Third-Party Libraries
---------------------
**MoltenVK** makes use of several third-party open-source libraries.
Development of some of these components is managed separately, and are retrieved into
**MoltenVK** as submodule repositories.
If you used the `--recursive` option when cloning this repository, as described
[above](#install), all third party libraries will have been retrieved.
If you did not use the `--recursive` option when cloning this repository, you can retrieve
and install these libraries into your `MoltenVK` repository environment as follows from within
the `MoltenVK` repository:
git submodule update --init --recursive
cd External
./makeAll
<a name="update_third-party"></a>
### Updating the Third-Party Library Versions
If you are developing enhancements to **MoltenVK**, you can update the versions of the
Third-Party libraries used by **MoltenVK** to the latest versions available by re-cloning
and re-building the submodules using the `getLatestAll` script:
cd External
./getLatestAll
The updated versions will then be "locked in" the next time the `MoltenVK` repository is committed to `git`.
This procdure updates all of the Third-Party library submodules. To update only a single submodule,
or for more information about the various Third-Party libraries and submodules used by **MoltenVK**,
please refer to the [`Docs/ThirdPartyConfig.md`](Docs/ThirdPartyConfig.md) document.
./fetchDependencies
For more information about the external open-source libraries used by **MoltenVK**,
see the [`External/README.md`](External/README.md) document.
<a name="building"></a>
Building **MoltenVK**
-------------------
>***Note:*** Before attempting to build **MoltenVK**, be sure you have followed the
instructions in the [*Third-Party Components*](#third-party) section above to retrieve
and install the required third-party components.
At development time, **MoltenVK** references advanced OS frameworks during building.
- *Xcode 9* or above is required to build and link **MoltenVK** projects.
@ -179,11 +127,6 @@ With this packaging structure, you can follow the [instructions below](#using) t
to the **MoltenVK** frameworks in the `Package/Latest` directory, to provide the flexibility to test your
app with either a **Debug** build, or a higher-performance **Release** build.
Once you have built the **MoltenVK** runtime distribution package, the **MoltenVK** demo apps can be
accessed from the `Demos/Demos.xcworkspace` *Xcode* workspace. This is the same workspace that is
included in the **MoltenVK** runtime distribution package, and you can use it to build and run the
**MoltenVK** demo apps, or to add new demos to this **MoltenVK** repository.
<a name="demos"></a>
@ -284,20 +227,3 @@ Property claims.
When contirbuting code, please honour the code formatting style found in existing **MoltenVK** source code.
In future, this will formally be enforced using `clang-format`.
<a name="credits"></a>
Third-Party Credits
-------------------
**MoltenVK** uses technology from the following open-source frameworks:
- [*Vulkan-Hpp*](https://github.com/KhronosGroup/Vulkan-Hpp)
- [*Vulkan-Docs*](https://github.com/KhronosGroup/Vulkan-Docs)
- [*Vulkan-LoaderAndValidationLayers*](https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers)
- [*VulkanSamples*](https://github.com/brenwill/VulkanSamples)
- [*SPIRV-Cross*](https://github.com/KhronosGroup/SPIRV-Cross)
- [*SPIRV-Tools*](https://github.com/KhronosGroup/SPIRV-Tools)
- [*glslang*](https://github.com/KhronosGroup/glslang)
- [*tinyxml2*](https://github.com/leethomason/tinyxml2)