From f0ba3dea825495b588840858be9ecd8b9caca61d Mon Sep 17 00:00:00 2001 From: Bill Hollings Date: Tue, 6 Mar 2018 15:06:10 -0500 Subject: [PATCH] Cube demo generate SPIR-V as part of demo project build. --- .../Demos/Demos.xcodeproj/project.pbxproj | 33 +++++++++++++++++++ Docs/ThirdPartyConfig.md | 14 +++----- External/getLatestVulkanSamples | 1 - External/makeAll | 2 -- External/makeVulkanSamples | 11 ------- MoltenVKPackaging.xcodeproj/project.pbxproj | 2 -- MoltenVKShaderConverter/Tools | 1 + 7 files changed, 38 insertions(+), 26 deletions(-) delete mode 100755 External/makeVulkanSamples create mode 120000 MoltenVKShaderConverter/Tools diff --git a/Demos/LunarG-VulkanSamples/Demos/Demos.xcodeproj/project.pbxproj b/Demos/LunarG-VulkanSamples/Demos/Demos.xcodeproj/project.pbxproj index c8acf73e..7ec96e10 100644 --- a/Demos/LunarG-VulkanSamples/Demos/Demos.xcodeproj/project.pbxproj +++ b/Demos/LunarG-VulkanSamples/Demos/Demos.xcodeproj/project.pbxproj @@ -226,6 +226,7 @@ isa = PBXNativeTarget; buildConfigurationList = A9B53B241C3AC0BE00ABC6F6 /* Build configuration list for PBXNativeTarget "Cube-macOS" */; buildPhases = ( + A9BA29C5204F24D400EA6575 /* Generate SPIR-V shaders */, A9B53B141C3AC0BE00ABC6F6 /* Resources */, A9B53B171C3AC0BE00ABC6F6 /* Sources */, A9B53B1B1C3AC0BE00ABC6F6 /* Frameworks */, @@ -244,6 +245,7 @@ isa = PBXNativeTarget; buildConfigurationList = A9B53B401C3AC15200ABC6F6 /* Build configuration list for PBXNativeTarget "Cube-iOS" */; buildPhases = ( + A9BA29C6204F298800EA6575 /* Generate SPIR-V shaders */, A9B53B2E1C3AC15200ABC6F6 /* Resources */, A9B53B331C3AC15200ABC6F6 /* Sources */, A9B53B371C3AC15200ABC6F6 /* Frameworks */, @@ -320,6 +322,37 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + A9BA29C5204F24D400EA6575 /* Generate SPIR-V shaders */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Generate SPIR-V shaders"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "set -e\n\n\"${PROJECT_DIR}/../../../MoltenVKShaderConverter/Tools/MoltenVKShaderConverter\" -gi -so -xs \"-\" -d \"${PROJECT_DIR}/../VulkanSamples/demos\"\n"; + }; + A9BA29C6204F298800EA6575 /* Generate SPIR-V shaders */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Generate SPIR-V shaders"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "set -e\n\n\"${PROJECT_DIR}/../../../MoltenVKShaderConverter/Tools/MoltenVKShaderConverter\" -gi -so -xs \"-\" -d \"${PROJECT_DIR}/../VulkanSamples/demos\"\n"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ A9B53B171C3AC0BE00ABC6F6 /* Sources */ = { isa = PBXSourcesBuildPhase; diff --git a/Docs/ThirdPartyConfig.md b/Docs/ThirdPartyConfig.md index 08d8591c..ed96de49 100644 --- a/Docs/ThirdPartyConfig.md +++ b/Docs/ThirdPartyConfig.md @@ -132,19 +132,13 @@ 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: -1. If you used the `--recursive` option when cloning the `MoltenVK` repository, you should already - have the `VulkanSamples` submodule, and you can skip to *Step 2* below. 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: +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 -2. 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 - ./makeVulkanSamples - diff --git a/External/getLatestVulkanSamples b/External/getLatestVulkanSamples index ed1b26a4..af5c5097 100755 --- a/External/getLatestVulkanSamples +++ b/External/getLatestVulkanSamples @@ -9,4 +9,3 @@ rm -rf VulkanSamples git clone https://github.com/brenwill/VulkanSamples.git -./makeVulkanSamples diff --git a/External/makeAll b/External/makeAll index b2603f0b..b84d5eb0 100755 --- a/External/makeAll +++ b/External/makeAll @@ -6,12 +6,10 @@ # makeVulkanSpec # makeSPIRVTools # makeglslang -# makeVulkanSamples # # macOS usage: ./makeAll ./makeVulkanSpec ./makeSPIRVTools ./makeglslang -./makeVulkanSamples diff --git a/External/makeVulkanSamples b/External/makeVulkanSamples deleted file mode 100755 index e399067f..00000000 --- a/External/makeVulkanSamples +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright (c) 2016-2018 The Brenwill Workshop Ltd. -# -# makeVulkanSamples - Configures VulkanSamples for use in demos. -# -# macOS usage: ./makeVulkanSpec - - -../Package/Latest/MoltenVKShaderConverter/Tools/MoltenVKShaderConverter -gi -so -xs "-" -d ./VulkanSamples/demos - diff --git a/MoltenVKPackaging.xcodeproj/project.pbxproj b/MoltenVKPackaging.xcodeproj/project.pbxproj index 85b214f5..abc33280 100644 --- a/MoltenVKPackaging.xcodeproj/project.pbxproj +++ b/MoltenVKPackaging.xcodeproj/project.pbxproj @@ -149,7 +149,6 @@ A9B732A51FC9C588006721CB /* getLatestSPIRVCross */ = {isa = PBXFileReference; lastKnownFileType = text; path = getLatestSPIRVCross; sourceTree = ""; }; A9B732A61FC9C588006721CB /* getLatestVulkanSpec */ = {isa = PBXFileReference; lastKnownFileType = text; path = getLatestVulkanSpec; sourceTree = ""; }; A9B732A71FCA1D71006721CB /* getLatestAll */ = {isa = PBXFileReference; lastKnownFileType = text; path = getLatestAll; sourceTree = ""; }; - A9CE6DAA204DF916005250D7 /* makeVulkanSamples */ = {isa = PBXFileReference; lastKnownFileType = text; path = makeVulkanSamples; sourceTree = ""; }; A9CE6DAB204DF924005250D7 /* getLatestVulkanSamples */ = {isa = PBXFileReference; lastKnownFileType = text; path = getLatestVulkanSamples; sourceTree = ""; }; /* End PBXFileReference section */ @@ -191,7 +190,6 @@ A939A6FC1F547A12006ACA0C /* makeAll */, A939A6FD1F547A12006ACA0C /* makeglslang */, A939A6FE1F547A12006ACA0C /* makeSPIRVTools */, - A9CE6DAA204DF916005250D7 /* makeVulkanSamples */, A939A6FF1F547A12006ACA0C /* makeVulkanSpec */, A9B732A71FCA1D71006721CB /* getLatestAll */, A9B732A31FC9C588006721CB /* getLatestglslang */, diff --git a/MoltenVKShaderConverter/Tools b/MoltenVKShaderConverter/Tools new file mode 120000 index 00000000..69daacc6 --- /dev/null +++ b/MoltenVKShaderConverter/Tools @@ -0,0 +1 @@ +../Package/Latest/MoltenVKShaderConverter/Tools \ No newline at end of file