Skip to content

Commit

Permalink
Merge pull request #851 from billhollings/master
Browse files Browse the repository at this point in the history
Update to Vulkan SDK 1.2.135 library dependencies.
  • Loading branch information
billhollings authored Apr 3, 2020
2 parents df11916 + 1c05cd4 commit 2352ae1
Show file tree
Hide file tree
Showing 14 changed files with 2,468 additions and 2,409 deletions.
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
language: objective-c

# macOS and Xcode Version
osx_image: xcode11.1
os: osx
osx_image: xcode11.3

# Build dependencies
# Travis has trouble with python3, which SPIRV-Tools requires,
# so skip the SPIRV-Tools build, and use templeted headers instead.
install:
- ./fetchDependencies -v --skip-spirv-tools-build

# Cache built deps
cache:
directories:
- External

script:
- xcodebuild -project MoltenVKPackaging.xcodeproj -scheme "MoltenVK Package"
- xcodebuild -workspace Demos/Demos.xcworkspace -scheme "Cube-macOS"
Expand Down
2 changes: 2 additions & 0 deletions Common/MVKOSExtensions.mm
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@


#include "MVKOSExtensions.h"
#include "MVKCommonEnvironment.h"
#include <mach/mach_host.h>
#include <mach/mach_time.h>
#include <mach/task.h>
#include <os/proc.h>

#import <Foundation/Foundation.h>

Expand Down
7 changes: 6 additions & 1 deletion Docs/Whats_New.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ For best results, use a Markdown reader.*
MoltenVK 1.0.41
---------------

Released 2020/03/30
Released 2020/04/05

- Accurately populate Vulkan `VkFormatProperties` from `MTLPixelFormat` capabilities,
taking into consideration variations across `MTLDevice` Features Sets.
Expand All @@ -29,14 +29,19 @@ Released 2020/03/30
- Add ability to disable command memory pooling using `MVK_CONFIG_USE_COMMAND_POOLING`
environment variable.
- Fix memory leak when pre-filling `MTLCommandBuffers` using `MVK_CONFIG_PREFILL_METAL_COMMAND_BUFFERS`.
- Fix issue causing screen captures from swapchain image to deadlock.
- Fix memory estimates for iOS 13+.
- Broaden conditions for host read sync for image memory barriers on macOS.
- Fix the `make install` build command to overwrite the existing framework in the system
framework library, and update `README.md` to clarify the instructions for using `make install`.
- Update the `README.md` and `MoltenVK_Runtime_UserGuide.md` documents to clarify that
**MoltenVK** is not a fully-compliant implementation of *Vulkan*.
- Support Xcode 11.4.
- Update dependency libraries to match *Vulkan SDK 1.2.135*.
- Update to latest SPIRV-Cross version:
- MSL: Support inline uniform blocks in argument buffers.
- MSL: Move inline uniform blocks to the end of the argument buffer.
- MSL: Fix access chain for deep struct hierarchy on array of buffers.
- MSL: Remove old memory_scope flag from iOS barriers.
- MSL: Fixes to array handling.

Expand Down
4,744 changes: 2,380 additions & 2,364 deletions ExternalDependencies.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

53 changes: 27 additions & 26 deletions ExternalRevisions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,17 +180,7 @@ library. However, after updating the version of *glslang* (which adds *SPIRV-Too
as described [above](#updating), if you encounter any building errors, you may need to re-add
the *SPIRV-Tools* library to the `ExternalDependencies` *Xcode* project as follows:

1. In the *Project Navigator*, remove the *Group* named `source` from under the *Group* named
`External/SPIRV-Tools`.

2. Drag the `External/glslang/External/spirv-tools/source` file folder to the `External/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 `SPIRV-Tools-macOS`
and `SPIRV-Tools-iOS` targets, and click the ***Finish*** button.

3. Remove the *Group* named `fuzz` from under the *Group* named `External/SPIRV-Tools/source`.

4. In the *Project Navigator* panel, select the `ExternalDependencies` *Xcode* project, then
1. In the *Project Navigator* panel, select the `ExternalDependencies` *Xcode* project, then
select the `SPIRV-Tools-macOS` target, and open the *Build Settings* tab. Locate the build
setting entry **Header Search Paths** (`HEADER_SEARCH_PATHS`) and add the following paths:

Expand All @@ -200,11 +190,21 @@ the *SPIRV-Tools* library to the `ExternalDependencies` *Xcode* project as follo
"$(SRCROOT)/External/glslang/External/spirv-tools/external/spirv-headers/include"
"$(SRCROOT)/External/glslang/External/spirv-tools/build"

5. Repeat *Step 4* for the `SPIRV-Tools-iOS` target within the `ExternalDependencies` *Xcode* project
2. Repeat *Step 1* for the `SPIRV-Tools-iOS` target within the `ExternalDependencies` *Xcode* project

3. In the *Project Navigator*, remove the *Group* named `source` from under the *Group* named
`External/SPIRV-Tools`.

4. Drag the `External/glslang/External/spirv-tools/source` file folder to the `External/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 `SPIRV-Tools-macOS`
and `SPIRV-Tools-iOS` targets, and click the ***Finish*** button.

5. Remove the *Group* named `fuzz` from under the *Group* named `External/SPIRV-Tools/source`.

6. Update `Templates/spirv-tools/build.zip` from the `*.h` and `*.inc` files in
`External/glslang/External/spirv-tools/build`, remove hidden `.*` files, and test
by running `./fetchDependencies --skip-spirv-tools-build`, and a **MoltenVK** build.
6. In the `Scripts` folder, run `./packagePregenSpirvToolsHeaders` to update `Templates/spirv-tools/build.zip`
from the `*.h` and `*.inc` files in `External/glslang/External/spirv-tools/build`, and test by running
`./fetchDependencies --skip-spirv-tools-build`, and a **MoltenVK** build.



Expand All @@ -217,10 +217,19 @@ library. However, after updating the version of *glslang*, as described [above](
if you encounter any building errors, you may need to re-add the *glslang* library to the
`ExternalDependencies` *Xcode* project as follows:

1. In the *Project Navigator*, remove all *Groups* from under the *Group* named
1. In the *Project Navigator* panel, select the `ExternalDependencies` *Xcode* project, then
select the `glslang-macOS` target, and open the *Build Settings* tab. Locate the build
setting entry **Header Search Paths** (`HEADER_SEARCH_PATHS`) and add the following paths:

$(inherited)
"$(SRCROOT)/External/glslang"

2. Repeat *Step 1* for the `glslang-iOS` target within the `ExternalDependencies` *Xcode* project

3. In the *Project Navigator*, remove all *Groups* from under the *Group* named
`External/glslang`.

2. Drag the following folders from the `External/glslang` file folder to the `External/glslang`
4. Drag the following folders from the `External/glslang` file folder to the `External/glslang`
*Group* in the *Project Navigator* panel:

glslang
Expand All @@ -230,19 +239,11 @@ if you encounter any building errors, you may need to re-add the *glslang* libra
In the ***Choose options for adding these files*** dialog that opens, select the ***Create groups*** option,
add the files to *both* the `glslang-macOS` and `glslang-iOS` targets, and click the ***Finish*** button.

3. In the *Project Navigator* panel, remove the references to the following files and folders:
5. In the *Project Navigator* panel, remove the references to the following files and folders:

External/glslang/glslang/MachineIndependant/glslang.y
External/glslang/glslang/OSDependent/Windows


4. In the *Project Navigator* panel, select the `ExternalDependencies` *Xcode* project, then
select the `glslang-macOS` target, and open the *Build Settings* tab. Locate the build
setting entry **Header Search Paths** (`HEADER_SEARCH_PATHS`) and add the following paths:

$(inherited)
"$(SRCROOT)/External/glslang"

5. Repeat *Step 4* for the `glslang-iOS` target within the `ExternalDependencies` *Xcode* project


2 changes: 1 addition & 1 deletion ExternalRevisions/SPIRV-Cross_repo_revision
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9b3c5e12be12c55533f3bd3ab9cc617ec0f393d8
e58e8d5dbe03ea2cc755dbaf43ffefa1b8d77bef
2 changes: 1 addition & 1 deletion ExternalRevisions/Vulkan-Tools_repo_revision
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4792a6854238ba3f6d10b8c7fcd11c102cae4ca6
7844b9b4e180612c7ca35bcb07ce7f86610b22c4
2 changes: 1 addition & 1 deletion ExternalRevisions/VulkanSamples_repo_revision
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9f72cf123c673e47679bb72caa06a17d7b0258dd
036541ca8f65333bf911b3957afa2c49f83fa0cd
2 changes: 1 addition & 1 deletion ExternalRevisions/glslang_repo_revision
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4fc7a33910fb8e40b970d160e1b38ab3f67fe0f3
e157435c1e777aa1052f446dafed162b4a722e03
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ clean:
xcodebuild -quiet -project "$(XCODE_PROJ)" -scheme "$(XCODE_SCHEME_BASE)" clean
rm -rf Package

#Likely requires 'sudo make install'
#Usually requires 'sudo make install'
.PHONY: install
install:
/bin/cp -a Package/Latest/MoltenVK/macOS/framework/MoltenVK.framework /Library/Frameworks/
rm -rf /Library/Frameworks/MoltenVK.framework
cp -a Package/Latest/MoltenVK/macOS/framework/MoltenVK.framework /Library/Frameworks/

8 changes: 6 additions & 2 deletions MoltenVK/MoltenVK/GPUObjects/MVKInstance.mm
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,12 @@
getDriverLayer()->getSupportedInstanceExtensions()));
logVersions(); // Log the MoltenVK and Vulkan versions

if (MVK_VULKAN_API_VERSION_CONFORM(MVK_VULKAN_API_VERSION) <
MVK_VULKAN_API_VERSION_CONFORM(_appInfo.apiVersion)) {
// If we only support Vulkan 1.0, we must report an error if a larger Vulkan version is requested.
// If we support Vulkan 1.1 or better, per spec, we never report an error.
if ((MVK_VULKAN_API_VERSION_CONFORM(MVK_VULKAN_API_VERSION) <
MVK_VULKAN_API_VERSION_CONFORM(VK_API_VERSION_1_1)) &&
(MVK_VULKAN_API_VERSION_CONFORM(MVK_VULKAN_API_VERSION) <
MVK_VULKAN_API_VERSION_CONFORM(_appInfo.apiVersion))) {
setConfigurationResult(reportError(VK_ERROR_INCOMPATIBLE_DRIVER,
"Request for Vulkan version %s is not compatible with supported version %s.",
mvkGetVulkanVersionString(_appInfo.apiVersion).c_str(),
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,21 @@ in the **_Release_** configuration from the command line. The following `make` t
make clean
make install


Running `make all` is the same as running both `make macos` and `make ios`. Running `make` with no
arguments is the same as running `make all`.

The `install` target will copy the most recently built *macOS* `MoltenVK.framework` into
the `/Library/Frameworks` folder of your computer. Since `/Library/Frameworks` is protected,
you will generally need to run it as `sudo make install` and enter your password.
you will generally need to run it as `sudo make install` and enter your password.

The default `make` command with no arguments is the same as `make all`.
The `install` target just installs the built framework, it does not first build the framework.
So you will first need to at least run `make macos`, or use *Xcode* to build the framework as described above.

The `make` targets all require that *Xcode* is installed on your system.

Building from the command line creates the same `Package` folder structure described above when building
from within *Xcode*.
Building from the command line creates the same `Package` folder structure described above when
building from within *Xcode*.


### Building Within a Larger External Build Environment
Expand Down
29 changes: 29 additions & 0 deletions Scripts/packagePregenSpirvToolsHeaders
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
#
# Copyright (c) 2016-2020 The Brenwill Workshop Ltd.
#
# packagePregenSpirvToolsHeaders - Packages Spirv-Tools headers to simplify building glslang
#
# macOS usage: ./packagePregenSpirvToolsHeaders
#

set -o errexit


# ----------------- Main -------------------

EXT_DIR=../External
SPV_TLS_BLD_DIR="${EXT_DIR}/glslang/External/spirv-tools/build"
TPLT_DIR=../Templates/spirv-tools
TPLT_BLD_DIR="${TPLT_DIR}/build"

rm -rf "${TPLT_BLD_DIR}"
mkdir -p "${TPLT_BLD_DIR}"
cp -a "${SPV_TLS_BLD_DIR}/"*.h "${SPV_TLS_BLD_DIR}/"*.inc "${TPLT_BLD_DIR}"

cd "${TPLT_DIR}"
rm -f build.zip
zip -qr build.zip build
rm -rf build/
cd - > /dev/null

Binary file modified Templates/spirv-tools/build.zip
Binary file not shown.

0 comments on commit 2352ae1

Please sign in to comment.