Replace dependency on Vulkan-LoaderAndValidationLayers with Vulkan-Headers and Vulkan-Tools.

Update to latest versions of Vulkan-Headers, SPIRV-Cross, glslang, Vulkan-Tools, and VulkanSamples.
This commit is contained in:
Bill Hollings 2018-05-28 08:33:46 -04:00
parent fff5ec9adf
commit c833cc544d
17 changed files with 1867 additions and 1773 deletions

11
.gitignore vendored
View File

@ -15,13 +15,12 @@ build/
*.[oa]
# Dependencies
External/Vulkan-LoaderAndValidationLayers
External/glslang
External/SPIRV-Tools
External/SPIRV-Headers
External/SPIRV-Cross
External/VulkanSamples
External/cereal
External/glslang
External/SPIRV-Cross
External/Vulkan-Headers
External/Vulkan-Tools
External/VulkanSamples
# Other source repository archive directories (protects when importing)
.hg

View File

@ -23,7 +23,7 @@
#include <MoltenVK/mvk_vulkan.h>
#ifdef MVK_SAMP_CUBE
# include "../Vulkan-LoaderAndValidationLayers/demos/cube.c"
# include "../Vulkan-Tools/cube/cube.c"
#endif

View File

@ -132,7 +132,7 @@
isa = PBXGroup;
children = (
A904B4641C99B5950008C013 /* Demos.h */,
A904B52C1C9A08C80008C013 /* demos */,
A904B52C1C9A08C80008C013 /* cube */,
A9B67B6A1C3AAE9800373FFD /* iOS */,
A9B67B811C3AAEA200373FFD /* macOS */,
A9295EAA1CECEF0900EFC483 /* Frameworks */,
@ -141,7 +141,7 @@
name = CustomTemplate;
sourceTree = "<group>";
};
A904B52C1C9A08C80008C013 /* demos */ = {
A904B52C1C9A08C80008C013 /* cube */ = {
isa = PBXGroup;
children = (
A904B52E1C9A08C90008C013 /* cube-frag.spv */,
@ -151,8 +151,8 @@
A904B5331C9A08C90008C013 /* cube.vert */,
A904B5351C9A08C90008C013 /* lunarg.ppm */,
);
name = demos;
path = "../Vulkan-LoaderAndValidationLayers/demos";
name = cube;
path = "../Vulkan-Tools/cube";
sourceTree = "<group>";
};
A9295EAA1CECEF0900EFC483 /* Frameworks */ = {
@ -335,7 +335,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -e\n\n\"${PROJECT_DIR}/../../../MoltenVKShaderConverter/Tools/MoltenVKShaderConverter\" -gi -so -xs \"-\" -d \"${PROJECT_DIR}/../Vulkan-LoaderAndValidationLayers/demos\"\n";
shellScript = "set -e\n\n\"${PROJECT_DIR}/../../../MoltenVKShaderConverter/Tools/MoltenVKShaderConverter\" -gi -so -xs \"-\" -d \"${PROJECT_DIR}/../Vulkan-Tools/cube\"\n";
};
A9BA29C6204F298800EA6575 /* Generate SPIR-V shaders */ = {
isa = PBXShellScriptBuildPhase;
@ -349,7 +349,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -e\n\n\"${PROJECT_DIR}/../../../MoltenVKShaderConverter/Tools/MoltenVKShaderConverter\" -gi -so -xs \"-\" -d \"${PROJECT_DIR}/../Vulkan-LoaderAndValidationLayers/demos\"\n";
shellScript = "set -e\n\n\"${PROJECT_DIR}/../../../MoltenVKShaderConverter/Tools/MoltenVKShaderConverter\" -gi -so -xs \"-\" -d \"${PROJECT_DIR}/../Vulkan-Tools/cube\"\n";
};
/* End PBXShellScriptBuildPhase section */
@ -480,7 +480,6 @@
HEADER_SEARCH_PATHS = (
"\"$(SRCROOT)/include\"",
"\"$(SRCROOT)/../../../MoltenVK/include\"",
"\"$(SRCROOT)/../Vulkan-LoaderAndValidationLayers/include\"",
);
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "-ObjC";
@ -505,7 +504,6 @@
HEADER_SEARCH_PATHS = (
"\"$(SRCROOT)/include\"",
"\"$(SRCROOT)/../../../MoltenVK/include\"",
"\"$(SRCROOT)/../Vulkan-LoaderAndValidationLayers/include\"",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = "com.moltenvk.${PRODUCT_NAME:identifier}";

View File

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

View File

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

View File

@ -17,10 +17,10 @@ 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)
- [Adding the *cereal* Library to the *MoltenVK Xcode* Project](#add_cereal)
- [Adding the *SPIRV-Cross* Library to the *MoltenVKShaderConverter Xcode* Project](#add_spirv-cross)
- [Adding the *glslang* Library to the *MoltenVKShaderConverter Xcode* Project](#add_glslang)
- [Adding the *SPIRV-Tools* Library to the *MoltenVKShaderConverter Xcode* Project](#add_spirv-tools)
@ -31,11 +31,12 @@ Fetching External Libraries
**MoltenVK** uses technology from the following external open-source libraries:
- [*cereal*](https://github.com/USCiLab/cereal)
- [*Vulkan-Headers*](https://github.com/KhronosGroup/Vulkan-Headers)
- [*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)
- [*Vulkan-Tools*](https://github.com/KhronosGroup/Vulkan-Tools)
- [*VulkanSamples*](https://github.com/LunarG/VulkanSamples)
These external open-source libraries are maintained in the `External` directory.
@ -57,33 +58,36 @@ determined as follows:
- **_cereal_**: a GitHub repository commit identifier found in the
`ExternalRevisions/cereal_repo_revision` file.
- **_Vulkan-Headers_**: a GitHub repository commit identifier found in the
`ExternalRevisions/Vulkan-Headers_repo_revision` file.
- **_SPIRV-Cross_**: a GitHub repository commit identifier found in the
`ExternalRevisions/SPIRV-Cross_repo_revision` file.
- **_VulkanSamples_**: a GitHub repository commit identifier found in the
`ExternalRevisions/VulkanSamples_repo_revision` file.
- **_Vulkan-LoaderAndValidationLayers_**: a GitHub repository commit identifier found
in the `ExternalRevisions/Vulkan-LoaderAndValidationLayers_repo_revision` file.
- **_glslang_**: automatically retrieved by the *Vulkan-LoaderAndValidationLayers* repository.
- **_glslang_**: a GitHub repository commit identifier found
in the `ExternalRevisions/glslang_repo_revision` file.
- **_SPIRV-Tools_**: automatically retrieved by the *glslang* repository.
- **_SPIRV-Headers_**: automatically retrieved by the *glslang* repository.
You can update which versions of the *SPIRV-Cross*, *VulkanSamples*,
*Vulkan-LoaderAndValidationLayers*, or *cereal* libraries are retrieved,
by changing the value held in the corresponding `*_repo_revision` file listed above.
- **_Vulkan-Tools_**: a GitHub repository commit identifier found in the
`ExternalRevisions/Vulkan-Tools_repo_revision` file.
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.
- **_VulkanSamples_**: a GitHub repository commit identifier found in the
`ExternalRevisions/VulkanSamples_repo_revision` file.
Once you have made changes, you can retrieve the updated library versions by running
the `fetchDependencies` script again.
You can update which versions of the *cereal*, *Vulkan-Headers*, *SPIRV-Cross*,
*glslang*, *Vulkan-Tools*, or *VulkanSamples* libraries are retrieved by changing
the value held in the corresponding `*_repo_revision` file listed above.
>***Note:*** If, after updating to new verions of the external libraries, you encounter
The version of the *SPIRV-Tools* and *SPIRV-Headers* libraries is automatically
determined by the version of the *glslang* library you have retrieved.
Once you have made changes to the `*_repo_revision` files, you can retrieve the
updated library versions by running the `fetchDependencies` script again.
>***Note:*** After updating to new verions of the external libraries, if 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.
@ -170,46 +174,6 @@ If you make changes to the `SPIRV-Cross` repository, you can regression test you
<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 building errors, you 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 the `MoltenVKShaderConverter` *Xcode* project, then select the
`MoltenVKSPIRVToMSLConverter-macOS` target, and open the *Build Settings* tab. Locate the build setting
entry **Header Search Paths** (`HEADER_SEARCH_PATHS`) and add the following paths:
"$(SRCROOT)/glslang/External/spirv-tools/include"
"$(SRCROOT)/glslang/External/spirv-tools/source"
"$(SRCROOT)/glslang/External/spirv-tools/external/spirv-headers/include"
"$(SRCROOT)/glslang/build/External/spirv-tools"
4. Repeat *Step 3* for the `MoltenVKSPIRVToMSLConverter-iOS` target within the `MoltenVKShaderConverter` *Xcode* project
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. Remove all occurrences of `path-to-SPIRV-Tools-repo-folder` from the paths to the
`source` directory added above.
<a name="add_glslang"></a>
Adding the *glslang* Library to the *MoltenVKShaderConverter Xcode* Project
---------------------------------------------------------------------------
@ -247,3 +211,43 @@ if you encounter any building errors, you may need to re-add the *glslang* libra
3. Open the `project.pbxproj` file in a text editor.
4. Remove all occurrences of `path-to-glslang-repo-folder` from the paths to the
`glslang`, `OGLCompilersDLL`, and `SPIRV` directories added above.
<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 building errors, you 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 the `MoltenVKShaderConverter` *Xcode* project, then select the
`MoltenVKSPIRVToMSLConverter-macOS` target, and open the *Build Settings* tab. Locate the build setting
entry **Header Search Paths** (`HEADER_SEARCH_PATHS`) and add the following paths:
"$(SRCROOT)/glslang/External/spirv-tools/include"
"$(SRCROOT)/glslang/External/spirv-tools/source"
"$(SRCROOT)/glslang/External/spirv-tools/external/spirv-headers/include"
"$(SRCROOT)/glslang/build/External/spirv-tools"
4. Repeat *Step 3* for the `MoltenVKSPIRVToMSLConverter-iOS` target within the `MoltenVKShaderConverter` *Xcode* project
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. Remove all occurrences of `path-to-SPIRV-Tools-repo-folder` from the paths to the
`source` directory added above.

View File

@ -1 +1 @@
f929c361c55b931f9eaa5c5396ee33585cf23796
6ef1c49ec0a9efdd8aebe42c68ba79b113f10bba

View File

@ -0,0 +1 @@
a901a3edf256c1a1441433e77feac919fb8e5ed6

View File

@ -1 +0,0 @@
3b13ef6a345fad42c573c93f9f2bfa6b35a90112

View File

@ -0,0 +1 @@
5e1623ca6860f3e393b1dabbdd19ba216871fa61

View File

@ -1 +1 @@
4d56b6cb5ce0682bd3ade4bb20791c7bc16c3ce8
eb0504823050186f63d4a820d76bc098b10cc4c5

View File

@ -0,0 +1 @@
92d05c0c83ef286c439781b35ef3d3cd27085802

View File

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

View File

@ -140,9 +140,11 @@
A943100220546CDD00F5CF87 /* fetchDependencies */ = {isa = PBXFileReference; lastKnownFileType = text; name = fetchDependencies; 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>"; };
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>"; };
A9D3560A20BB3A2900BE295C /* glslang_repo_revision */ = {isa = PBXFileReference; lastKnownFileType = text; path = glslang_repo_revision; sourceTree = "<group>"; };
A9D3560B20BB3A5600BE295C /* Vulkan-Headers_repo_revision */ = {isa = PBXFileReference; lastKnownFileType = text; path = "Vulkan-Headers_repo_revision"; sourceTree = "<group>"; };
A9D3560C20BB3A7200BE295C /* Vulkan-Tools_repo_revision */ = {isa = PBXFileReference; lastKnownFileType = text; path = "Vulkan-Tools_repo_revision"; sourceTree = "<group>"; };
A9EE46412065766C00193200 /* cereal_repo_revision */ = {isa = PBXFileReference; lastKnownFileType = text; path = cereal_repo_revision; sourceTree = "<group>"; };
/* End PBXFileReference section */
@ -183,8 +185,10 @@
A9AD67E92055D8A600ED3C08 /* README.md */,
A943100220546CDD00F5CF87 /* fetchDependencies */,
A9EE46412065766C00193200 /* cereal_repo_revision */,
A9D3560A20BB3A2900BE295C /* glslang_repo_revision */,
A9AD67D32054E2D700ED3C08 /* SPIRV-Cross_repo_revision */,
A9AD67D22054E2D700ED3C08 /* Vulkan-LoaderAndValidationLayers_repo_revision */,
A9D3560B20BB3A5600BE295C /* Vulkan-Headers_repo_revision */,
A9D3560C20BB3A7200BE295C /* Vulkan-Tools_repo_revision */,
A9AD67D12054E2D700ED3C08 /* VulkanSamples_repo_revision */,
);
name = External;

View File

@ -1 +1 @@
../External/Vulkan-LoaderAndValidationLayers/external/glslang
../External/glslang

View File

@ -4,17 +4,8 @@
#
# fetchDependencies - Retrieves the correct versions of all dependencies
#
# macOS usage: ./fetchDependencies [--v-lvl-root path] [--glslang-root path]
# macOS usage: ./fetchDependencies
#
# --v-lvl-root path
# "path" specifies a directory path to a
# KhronosGroup/Vulkan-LoaderAndValidationLayers repository.
# This repository does not have to be built.
# --glslang-root path
# "path" specifies a directory path to a KhronosGroup/glslang
# repository. This repository does need to be built and the
# build directory must be in the specified directory.
# It should be built the same way this script builds it.
# ----------------- Functions -------------------
@ -49,10 +40,10 @@ build_repo() {
mkdir -p $1/build
cd $1/build
if type ninja >/dev/null 2>&1 ; then
cmake .. -G Ninja
cmake .. -G Ninja -D CMAKE_BUILD_TYPE=Release
ninja
else
cmake ..
cmake .. -D CMAKE_BUILD_TYPE=Release
make
fi
cd -
@ -63,27 +54,6 @@ build_repo() {
EXT_DIR=External
EXT_REV_DIR=ExternalRevisions
V_LVL_NAME=Vulkan-LoaderAndValidationLayers
GLSLANG_NAME=glslang
V_LVL_ROOT=""
GLSLANG_ROOT=""
while (( "$#" )); do
case "$1" in
--v-lvl-root)
V_LVL_ROOT=$2
shift 2
;;
--glslang-root)
GLSLANG_ROOT=$2
shift 2
;;
-*|--*=)
echo "Error: Unsupported flag $1" >&2
exit 1
;;
esac
done
echo
echo Retrieving MoltenVK dependencies into ${EXT_DIR}.
@ -101,6 +71,15 @@ REPO_REV=$(cat "../${EXT_REV_DIR}/${REPO_NAME}_repo_revision")
update_repo ${REPO_NAME} ${REPO_URL} ${REPO_REV}
# ----------------- Vulkan-Headers -------------------
REPO_NAME=Vulkan-Headers
REPO_URL="https://github.com/KhronosGroup/${REPO_NAME}.git"
REPO_REV=$(cat "../${EXT_REV_DIR}/${REPO_NAME}_repo_revision")
update_repo ${REPO_NAME} ${REPO_URL} ${REPO_REV}
# ----------------- SPIRV-Cross -------------------
REPO_NAME=SPIRV-Cross
@ -110,6 +89,30 @@ REPO_REV=$(cat "../${EXT_REV_DIR}/${REPO_NAME}_repo_revision")
update_repo ${REPO_NAME} ${REPO_URL} ${REPO_REV}
# ----------------- glslang -------------------
REPO_NAME=glslang
REPO_URL="https://github.com/KhronosGroup/${REPO_NAME}.git"
REPO_REV=$(cat "../${EXT_REV_DIR}/${REPO_NAME}_repo_revision")
update_repo ${REPO_NAME} ${REPO_URL} ${REPO_REV}
cd ${REPO_NAME}
./update_glslang_sources.py
cd -
build_repo ${REPO_NAME}
# ----------------- Vulkan-Tools -------------------
REPO_NAME=Vulkan-Tools
REPO_URL="https://github.com/KhronosGroup/${REPO_NAME}.git"
REPO_REV=$(cat "../${EXT_REV_DIR}/${REPO_NAME}_repo_revision")
update_repo ${REPO_NAME} ${REPO_URL} ${REPO_REV}
# ----------------- VulkanSamples -------------------
REPO_NAME=VulkanSamples
@ -119,29 +122,5 @@ REPO_REV=$(cat "../${EXT_REV_DIR}/${REPO_NAME}_repo_revision")
update_repo ${REPO_NAME} ${REPO_URL} ${REPO_REV}
# ----------------- Vulkan-LoaderAndValidationLayers -------------------
# When MoltenVK is built by something that already has a copy of the
# Vulkan-LoaderAndValidationLayers repo, use it by creating a symlink.
if [ ! "$V_LVL_ROOT" = "" ]; then
REPO_NAME=${V_LVL_NAME}
rm -rf ${REPO_NAME}
ln -sfn ${V_LVL_ROOT} ${REPO_NAME}
else
REPO_NAME=${V_LVL_NAME}
REPO_URL="https://github.com/KhronosGroup/${REPO_NAME}.git"
REPO_REV=$(cat "../${EXT_REV_DIR}/${REPO_NAME}_repo_revision")
update_repo ${REPO_NAME} ${REPO_URL} ${REPO_REV}
cd ${REPO_NAME}
./update_external_sources.sh -g
cd -
fi
cd ..