Skip to content

Commit

Permalink
Merge branch 'geometry-shaders' into geometry-shaders
Browse files Browse the repository at this point in the history
  • Loading branch information
billhollings authored Apr 4, 2023
2 parents aeb25c1 + d99356d commit 23f70f8
Show file tree
Hide file tree
Showing 200 changed files with 6,611 additions and 5,092 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ jobs:
build:
strategy:
matrix:
xcode: [ "13.2.1" ]
xcode: [ "14.2" ]
platform: [ "macos", "maccat", "ios", "tvos" ]
os: [ "macos-latest" ]
upload_artifacts: [ true ]
# additional specific configurations
include:
# "Legacy" Xcode 11.7 & 12.5.1 macOS builds
- xcode: "11.7"
# "Legacy" Xcode 12.5.1 & 11.7 macOS builds
- xcode: "12.5.1"
platform: "macos"
os: "macos-10.15"
os: "macos-11"
upload_artifacts: false
- xcode: "12.5.1"
- xcode: "11.7"
platform: "macos"
os: "macos-11"
os: "macos-11"
upload_artifacts: false
fail-fast: false

Expand Down
5 changes: 2 additions & 3 deletions Common/MVKCommonEnvironment.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* MVKCommonEnvironment.h
*
* Copyright (c) 2015-2022 The Brenwill Workshop Ltd. (http://www.brenwill.com)
* Copyright (c) 2015-2023 The Brenwill Workshop Ltd. (http://www.brenwill.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -102,8 +102,7 @@ extern "C" {
#endif

/** Directive to identify public symbols. */
#define MVK_PUBLIC_SYMBOL __attribute__((visibility("default")))

#define MVK_PUBLIC_SYMBOL __attribute__((visibility("default"))) __attribute__((used))

/** Directive to make a public alias of another symbol. */
#define MVK_PUBLIC_ALIAS(ALIAS, TARGET) asm(".globl _" #ALIAS "\n\t_" #ALIAS " = _" #TARGET)
Expand Down
4 changes: 3 additions & 1 deletion Common/MVKOSExtensions.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* MVKOSExtensions.h
*
* Copyright (c) 2015-2022 The Brenwill Workshop Ltd. (http://www.brenwill.com)
* Copyright (c) 2015-2023 The Brenwill Workshop Ltd. (http://www.brenwill.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -162,3 +162,5 @@ uint64_t mvkGetAvailableMemorySize();
/** Returns the amount of memory currently used by this process. */
uint64_t mvkGetUsedMemorySize();

/** Returns the size of a page of host memory on this platform. */
uint64_t mvkGetHostMemoryPageSize();
4 changes: 3 additions & 1 deletion Common/MVKOSExtensions.mm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* MVKOSExtensions.mm
*
* Copyright (c) 2015-2022 The Brenwill Workshop Ltd. (http://www.brenwill.com)
* Copyright (c) 2015-2023 The Brenwill Workshop Ltd. (http://www.brenwill.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -136,3 +136,5 @@ uint64_t mvkGetUsedMemorySize() {
return 0;
}

uint64_t mvkGetHostMemoryPageSize() { return sysconf(_SC_PAGESIZE); }

2 changes: 1 addition & 1 deletion Common/MVKStrings.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* MVKStrings.h
*
* Copyright (c) 2015-2022 The Brenwill Workshop Ltd. (http://www.brenwill.com)
* Copyright (c) 2015-2023 The Brenwill Workshop Ltd. (http://www.brenwill.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Demos/Cube/Cube.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1400;
LastUpgradeCheck = 1410;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Cube" */;
compatibilityVersion = "Xcode 8.0";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1400"
LastUpgradeVersion = "1410"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1400"
LastUpgradeVersion = "1410"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1400"
LastUpgradeVersion = "1410"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Demos/Cube/iOS/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* AppDelegate.h
*
* Copyright (c) 2015-2022 The Brenwill Workshop Ltd. (http://www.brenwill.com)
* Copyright (c) 2015-2023 The Brenwill Workshop Ltd. (http://www.brenwill.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Demos/Cube/iOS/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* AppDelegate.m
*
* Copyright (c) 2015-2022 The Brenwill Workshop Ltd. (http://www.brenwill.com)
* Copyright (c) 2015-2023 The Brenwill Workshop Ltd. (http://www.brenwill.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Demos/Cube/iOS/DemoViewController.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* DemoViewController.h
*
* Copyright (c) 2015-2022 The Brenwill Workshop Ltd. (http://www.brenwill.com)
* Copyright (c) 2015-2023 The Brenwill Workshop Ltd. (http://www.brenwill.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Demos/Cube/iOS/DemoViewController.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* DemoViewController.m
*
* Copyright (c) 2015-2022 The Brenwill Workshop Ltd. (http://www.brenwill.com)
* Copyright (c) 2015-2023 The Brenwill Workshop Ltd. (http://www.brenwill.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Demos/Cube/iOS/main.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* main.m
*
* Copyright (c) 2015-2022 The Brenwill Workshop Ltd. (http://www.brenwill.com)
* Copyright (c) 2015-2023 The Brenwill Workshop Ltd. (http://www.brenwill.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Demos/Cube/macOS/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* AppDelegate.h
*
* Copyright (c) 2015-2022 The Brenwill Workshop Ltd. (http://www.brenwill.com)
* Copyright (c) 2015-2023 The Brenwill Workshop Ltd. (http://www.brenwill.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Demos/Cube/macOS/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* AppDelegate.m
*
* Copyright (c) 2015-2022 The Brenwill Workshop Ltd. (http://www.brenwill.com)
* Copyright (c) 2015-2023 The Brenwill Workshop Ltd. (http://www.brenwill.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Demos/Cube/macOS/DemoViewController.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* DemoViewController.h
*
* Copyright (c) 2015-2022 The Brenwill Workshop Ltd. (http://www.brenwill.com)
* Copyright (c) 2015-2023 The Brenwill Workshop Ltd. (http://www.brenwill.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Demos/Cube/macOS/DemoViewController.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* DemoViewController.m
*
* Copyright (c) 2015-2022 The Brenwill Workshop Ltd. (http://www.brenwill.com)
* Copyright (c) 2015-2023 The Brenwill Workshop Ltd. (http://www.brenwill.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Demos/Cube/macOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright (c) 2015-2022 The Brenwill Workshop Ltd. All rights reserved.</string>
<string>Copyright (c) 2015-2023 The Brenwill Workshop Ltd. All rights reserved.</string>
<key>NSMainStoryboardFile</key>
<string>Main</string>
<key>NSPrincipalClass</key>
Expand Down
2 changes: 1 addition & 1 deletion Demos/Cube/macOS/main.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* main.m
*
* Copyright (c) 2015-2022 The Brenwill Workshop Ltd. (http://www.brenwill.com)
* Copyright (c) 2015-2023 The Brenwill Workshop Ltd. (http://www.brenwill.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Demos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#MoltenVK Demo Projects

Copyright (c) 2015-2022 [The Brenwill Workshop Ltd.](http://www.brenwill.com)
Copyright (c) 2015-2023 [The Brenwill Workshop Ltd.](http://www.brenwill.com)

[comment]: # "This document is written in Markdown (http://en.wikipedia.org/wiki/Markdown) format."
[comment]: # "For best results, use a Markdown reader."
Expand Down
60 changes: 58 additions & 2 deletions Docs/MoltenVK_Runtime_UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
MoltenVK Runtime User Guide
===========================

Copyright (c) 2015-2022 [The Brenwill Workshop Ltd.](http://www.brenwill.com)
Copyright (c) 2015-2023 [The Brenwill Workshop Ltd.](http://www.brenwill.com)

[comment]: # "This document is written in Markdown (http://en.wikipedia.org/wiki/Markdown) format."
[comment]: # "For best results, use a Markdown reader."
Expand All @@ -22,6 +22,7 @@ Table of Contents
- [Installing **MoltenVK** in Your *Vulkan* Application](#install)
- [Install *MoltenVK* as a Universal `XCFramework`](#install_xcfwk)
- [Install *MoltenVK* as a Dynamic Library](#install_dylib)
- [Install *MoltenVK* replacing the Vulkan SDK `libMoltenVK.dylib`](#install_vksdk)
- [Build and Runtime Requirements](#requirements)
- [Interacting with the **MoltenVK** Runtime](#interaction)
- [MoltenVK `VK_MVK_moltenvk` Extension](#moltenvk_extension)
Expand Down Expand Up @@ -53,7 +54,7 @@ distribution package, see the main [`README.md`](../README.md) document in the `
About **MoltenVK**
------------------

**MoltenVK** is a layered implementation of [*Vulkan 1.1*](https://www.khronos.org/vulkan)
**MoltenVK** is a layered implementation of [*Vulkan 1.2*](https://www.khronos.org/vulkan)
graphics and compute functionality, that is built on Apple's [*Metal*](https://developer.apple.com/metal)
graphics and compute framework on *macOS*, *iOS*, and *tvOS*. **MoltenVK** allows you to use *Vulkan*
graphics and compute functionality to develop modern, cross-platform, high-performance graphical games
Expand Down Expand Up @@ -87,6 +88,20 @@ as an `XCFramework`, as it is the simpler option, and encompasses the largest se
<a name="install_xcfwk"></a>
### Install *MoltenVK* as a Universal `XCFramework`

> ***Note:*** *Xcode 14* introduced a new static linkage model that is not compatible with previous
versions of *Xcode*. If you link to a `MoltenVK.xcframework` that was built with *Xcode 14* or later,
also use *Xcode 14* or later to link it to your app or game.
>
> If you need to use *Xcode 13* or earlier to link `MoltenVK.xcframework` to your app or game,
first [build](../README.md#building) **MoltenVK** with *Xcode 13* or earlier.
>
> Or, if you want to use *Xcode 14* or later to [build](../README.md#building) **MoltenVK**, in order to be able to use the latest
*Metal* capabilities, but need to use *Xcode 13* or earlier to link `MoltenVK.xcframework` to your
app or game, first add the value `-fno-objc-msgsend-selector-stubs` to the `OTHER_CFLAGS`
*Xcode* build setting in the `MoltenVK.xcodeproj` and `MoltenVKShaderConverter.xcodeproj` *Xcode*
projects, [build](../README.md#building) **MoltenVK** with *Xcode 14* or later, and then link `MoltenVK.xcframework`
to your app or game using *Xcode 13* or earlier.

To link **MoltenVK** to your application as an `XCFramework`, follow these steps:

1. Open your application in *Xcode* and select your application's target in the
Expand Down Expand Up @@ -205,6 +220,39 @@ To link **MoltenVK** to your application as a dynamic library (`.dylib`), follow
- `MoltenVK/dylib/tvOS/libMoltenVK.dylib` *(tvOS)*


<a name="install_vksdk"></a>
### Install *MoltenVK* replacing the Vulkan SDK `libMoltenVK.dylib`

There are a few potential issues when building **MoltenVK** to replace the version installed via
the *[Vulkan SDK](https://vulkan.lunarg.com/sdk/home)* standard install process, which lives in
`/usr/local/lib/libMoltenVK.dylib`.

1. You must *remove* the existing `.dylib` file before copying the new one, because of the way
that the gatekeeper system works to prevent malicious overwriting of files in standard locations
such as `/usr/local`:

```bash
$ sudo rm /usr/local/lib/libMoltenVK.dylib
$ sudo cp Package/Release/MoltenVK/dylib/macOS/libMoltenVK.dylib /usr/local/lib
```

If you do not do the remove first, your application will terminate immediately with a
singularly unhelpful `Killed: 9` message. Alternatively, moving the existing `.dylib` to a
backup name and making a symbolic link to the Package location above is particularly useful
for repeated building and testing.

2. Do *not* copy the `MoltenVK_icd.json` file from the newly-built package to
`/usr/local/share/vulkan/icd.d` -- it will not work and will result in errors about not being
able to initialize the instance. The one installed by Vulkan SDK uses a relative path to
specify the location of the `.dylib`, whereas the one in the package specifies it in the same
directory.

3. The default config for command-line build has verbose logging info turned on -- if you want
it to be like the original, use this command for building:

```bash
$ make macos MVK_CONFIG_LOG_LEVEL=1
```

<a name="requirements"></a>
### Build and Runtime Requirements
Expand Down Expand Up @@ -264,6 +312,7 @@ In addition to core *Vulkan* functionality, **MoltenVK** also supports the foll
- `VK_KHR_8bit_storage`
- `VK_KHR_bind_memory2`
- `VK_KHR_buffer_device_address` *(requires GPU Tier 2 argument buffers support)*
- `VK_KHR_copy_commands2`
- `VK_KHR_create_renderpass2`
- `VK_KHR_dedicated_allocation`
- `VK_KHR_depth_stencil_resolve`
Expand All @@ -281,6 +330,7 @@ In addition to core *Vulkan* functionality, **MoltenVK** also supports the foll
- `VK_KHR_maintenance1`
- `VK_KHR_maintenance2`
- `VK_KHR_maintenance3`
- `VK_KHR_map_memory2`
- `VK_KHR_multiview`
- `VK_KHR_portability_subset`
- `VK_KHR_push_descriptor`
Expand All @@ -292,6 +342,7 @@ In addition to core *Vulkan* functionality, **MoltenVK** also supports the foll
- `VK_KHR_shader_float_controls`
- `VK_KHR_shader_float16_int8`
- `VK_KHR_shader_subgroup_extended_types` *(requires Metal 2.1 on Mac or Metal 2.2 and Apple family 4 on iOS)*
- `VK_KHR_spirv_1_4`
- `VK_KHR_storage_buffer_storage_class`
- `VK_KHR_surface`
- `VK_KHR_swapchain`
Expand All @@ -306,23 +357,28 @@ In addition to core *Vulkan* functionality, **MoltenVK** also supports the foll
- `VK_EXT_descriptor_indexing` *(initial release limited to Metal Tier 1: 96/128 textures,
16 samplers, except macOS 11.0 (Big Sur) or later, or on older versions of macOS using
an Intel GPU, and if Metal argument buffers enabled in config)*
- `VK_EXT_external_memory_host`
- `VK_EXT_fragment_shader_interlock` *(requires Metal 2.0 and Raster Order Groups)*
- `VK_EXT_host_query_reset`
- `VK_EXT_image_robustness`
- `VK_EXT_inline_uniform_block`
- `VK_EXT_memory_budget` *(requires Metal 2.0)*
- `VK_EXT_metal_objects`
- `VK_EXT_metal_surface`
- `VK_EXT_pipeline_creation_cache_control`
- `VK_EXT_post_depth_coverage` *(iOS and macOS, requires family 4 (A11) or better Apple GPU)*
- `VK_EXT_private_data `
- `VK_EXT_robustness2`
- `VK_EXT_sample_locations`
- `VK_EXT_scalar_block_layout`
- `VK_EXT_separate_stencil_usage`
- `VK_EXT_shader_atomic_float` *(requires Metal 3.0)*
- `VK_EXT_shader_stencil_export` *(requires Mac GPU family 2 or iOS GPU family 5)*
- `VK_EXT_shader_viewport_index_layer`
- `VK_EXT_subgroup_size_control` *(requires Metal 2.1 on Mac or Metal 2.2 and Apple family 4 on iOS)*
- `VK_EXT_surface_maintenance1`
- `VK_EXT_swapchain_colorspace`
- `VK_EXT_swapchain_maintenance1`
- `VK_EXT_vertex_attribute_divisor`
- `VK_EXT_texel_buffer_alignment` *(requires Metal 2.0)*
- `VK_EXT_texture_compression_astc_hdr` *(iOS and macOS, requires family 6 (A13) or better Apple GPU)*
Expand Down
Loading

0 comments on commit 23f70f8

Please sign in to comment.