diff --git a/Common/MVKCommonEnvironment.h b/Common/MVKCommonEnvironment.h index 548fd2044..25aa1df18 100644 --- a/Common/MVKCommonEnvironment.h +++ b/Common/MVKCommonEnvironment.h @@ -136,7 +136,7 @@ extern "C" { * conflicts when bound to a Vulkan Loader that also exports identical symbols. */ #ifndef MVK_HIDE_VULKAN_SYMBOLS -# define MVK_HIDE_VULKAN_SYMBOLS 0 +# define MVK_HIDE_VULKAN_SYMBOLS 1 #endif #if MVK_HIDE_VULKAN_SYMBOLS # define MVK_PUBLIC_VULKAN_SYMBOL diff --git a/Demos/README.md b/Demos/README.md index 4841210c6..12ff74262 100644 --- a/Demos/README.md +++ b/Demos/README.md @@ -33,13 +33,7 @@ This demo renders a basic textured cube that spins in place. The demo can be found in the `Cube` folder, and in the `Cube` group in the *Xcode Project Navigator* in the `Demos.xcworkspace` *Xcode* workspace. -The _Cube_ demo uses _Volk_, which requires Vulkan API static call symbols (`vk*`) to be hidden. -Before building and running the _Cube_ demo, build **MoltenVK** with the `MVK_HIDE_VULKAN_SYMBOLS` -build setting enabled, such as with the following command-line command: - - make MVK_HIDE_VULKAN_SYMBOLS=1 - -Then, to run this demo, run the `Cube-iOS`, `Cube-tvOS`, or `Cube-macOS` *Scheme* from within *Xcode*. +To run this demo, run the `Cube-macOS`, `Cube-iOS`, or `Cube-tvOS` *Scheme* from within *Xcode*. In addition to devices, this demo will also run on the `iOS Simulator` or `tvOS Simulator` destinations. The `Cube` demo is a simple example of installing **MoltenVK** as an `XCFramework` that is diff --git a/Docs/Whats_New.md b/Docs/Whats_New.md index 552ffbcc7..129a39287 100644 --- a/Docs/Whats_New.md +++ b/Docs/Whats_New.md @@ -25,6 +25,7 @@ Released 2024/01/08 - `VK_EXT_extended_dynamic_state3` *(Metal does not support `VK_POLYGON_MODE_POINT`)* - `VK_EXT_headless_surface` - `VK_EXT_layer_settings` +- **MoltenVK** build now hides static _Vulkan_ API symbols by default (build setting `MVK_HIDE_VULKAN_SYMBOLS=1` by default). - Add support for format `VK_FORMAT_B4G4R4A4_UNORM_PACK16`. - Add support for vertex formats `VK_FORMAT_B10G11R11_UFLOAT_PACK32` & `VK_FORMAT_E5B9G9R9_UFLOAT_PACK32`. - Fix regression that broke `VK_POLYGON_MODE_LINE`. @@ -48,7 +49,7 @@ Released 2024/01/08 - Deprecate `vkSetMoltenVKConfigurationMVK()`. - Deprecate `mvk_config.h` and move content to `mvk_private_api.h` and `mvk_deprecated_api.h`. - Update copyright notices to year 2024. -- Update dependency libraries to match _Vulkan SDK 1.3.273_. +- Update dependency libraries to match _Vulkan SDK 1.3.275_. - Update to latest SPIRV-Cross: - MSL: Fix regression error in argument buffer runtime arrays. - MSL: Work around broken cube texture gradients on Apple Silicon. diff --git a/ExternalRevisions/SPIRV-Cross_repo_revision b/ExternalRevisions/SPIRV-Cross_repo_revision index 219b99955..515aaf6b7 100644 --- a/ExternalRevisions/SPIRV-Cross_repo_revision +++ b/ExternalRevisions/SPIRV-Cross_repo_revision @@ -1 +1 @@ -d9f4280f4511e9bff9bdd5147370b9ee49dbe2af +117161dd546075a568f0526bccffcd7e0bc96897 diff --git a/ExternalRevisions/Vulkan-Headers_repo_revision b/ExternalRevisions/Vulkan-Headers_repo_revision index abc188012..afc524564 100644 --- a/ExternalRevisions/Vulkan-Headers_repo_revision +++ b/ExternalRevisions/Vulkan-Headers_repo_revision @@ -1 +1 @@ -41263fc5aa994b8eafaca946583bfcceca8ca419 +217e93c664ec6704ec2d8c36fa116c1a4a1e2d40 diff --git a/ExternalRevisions/Vulkan-Tools_repo_revision b/ExternalRevisions/Vulkan-Tools_repo_revision index 631db3506..3a663ab42 100644 --- a/ExternalRevisions/Vulkan-Tools_repo_revision +++ b/ExternalRevisions/Vulkan-Tools_repo_revision @@ -1 +1 @@ -afb8b9e8caeade2489372b8cf78b70b5301c8741 +2c0a644db855f40f100f9f39e5a8a8dfa2b0014d diff --git a/ExternalRevisions/glslang_repo_revision b/ExternalRevisions/glslang_repo_revision index 83b8f136e..e4f9fcd3c 100644 --- a/ExternalRevisions/glslang_repo_revision +++ b/ExternalRevisions/glslang_repo_revision @@ -1 +1 @@ -719b6b7debbfe75bd427daa0e39c347fce16cf9a +a91631b260cba3f22858d6c6827511e636c2458a diff --git a/Makefile b/Makefile index 89523db11..fa48c9b44 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ else OUTPUT_FMT_CMD = -quiet endif -# Collect all variables defined on the command-line (eg: MVK_HIDE_VULKAN_SYMBOLS=1) +# Collect all build settings defined on the command-line (eg: MVK_HIDE_VULKAN_SYMBOLS=0, MVK_CONFIG_LOG_LEVEL=3...) MAKEARGS := $(strip \ $(foreach v,$(.VARIABLES),\ $(if $(filter command\ line,$(origin $(v))),\ diff --git a/README.md b/README.md index fde1c5f6e..484ff48dc 100644 --- a/README.md +++ b/README.md @@ -295,19 +295,23 @@ or ...etc. -### Hiding Vulkan API Symbols +### Exposing Static Vulkan API Symbols -You can optionally build MoltenVK with the Vulkan API static call symbols (`vk*`) hidden, -to avoid library linking conflicts when bound to a Vulkan Loader that also exports identical symbols. +For default compatability with the _Vulkan SDK_ loader environment, by default, **MoltenVK** hides +static access to the _Vulkan_ API symbols (`vk*`), in favor of using the standard _Vulkan_ +function pointers retrieved using `vkGetInstanceProcAddr()` and `vkGetDeviceProcAddr()`. -To do so, when building MoltenVK, set the build setting `MVK_HIDE_VULKAN_SYMBOLS=1`. +If you are not using the _Vulkan_ loader, and wish to statically link to the _Vulkan_ API symbols, +you can optionally build **MoltenVK** with the _Vulkan_ API static call symbols exposed. + +To do so, when building **MoltenVK**, set the build setting `MVK_HIDE_VULKAN_SYMBOLS=0`. This build setting can be set in the `MoltenVK.xcodeproj` *Xcode* project, or it can be included in any of the `make` build commands. For example: - make MVK_HIDE_VULKAN_SYMBOLS=1 + make MVK_HIDE_VULKAN_SYMBOLS=0 or - make macos MVK_HIDE_VULKAN_SYMBOLS=1 + make macos MVK_HIDE_VULKAN_SYMBOLS=0 ...etc. diff --git a/Templates/spirv-tools/build.zip b/Templates/spirv-tools/build.zip index 5f27a501a..31889a3c6 100644 Binary files a/Templates/spirv-tools/build.zip and b/Templates/spirv-tools/build.zip differ