40 Commits

Author SHA1 Message Date
Isaac Marovitz
0a7fcec0f6
Enable Private API calls 2024-05-08 17:08:15 -04:00
Mike Krus
9082ca839f Fix visionOS build
This adds a few macros to test which platform is currently being built.
Addresses some compile warnings such as missing return values.
2024-03-01 18:28:16 +00:00
Chip Davis
8d1303a57a MVKPipeline: Support framebuffer logic operations.
This support was always there in Metal. It was just hidden from public
view--but not from prying eyes on the Objective-C metadata.

I had initially thought they were using OpenGL/Vulkan values for the
logic operation. When that didn't work, I then tried D3D11 values. I
guess D3D11 makes sense, because the Intel GPU drivers were the first to
support this in Metal.

Move the definition of `MVK_USE_METAL_PRIVATE_API` into
`"MVKCommonEnvironment.h"` so we can use it from non-C++ code.
2024-01-29 15:37:29 -07:00
Bill Hollings
8a675aa3a8 Revert to disabling MVK_HIDE_VULKAN_SYMBOLS by default.
- Statically expose vkGetInstanceProcAddr(), even
  when MVK_HIDE_VULKAN_SYMBOLS is enabled.
- To support Volk, link Cube demo dynamically to libMoltenVK.dylib
  instead of statically to MoltenVK.xcframework.
2024-01-10 17:16:33 -05:00
Bill Hollings
cb460524d7 Update dependency libraries to match Vulkan SDK 1.3.275.
- Hide static Vulkan API symbols by default
  (build setting MVK_HIDE_VULKAN_SYMBOLS=1 by default).
- Update documentation.
2024-01-09 08:17:16 -05:00
Bill Hollings
d9f75ed812 Update copyright notices to year 2024. 2024-01-04 14:51:53 -05:00
Bill Hollings
10625a8638 Add support for VK_EXT_layer_settings extension. 2023-09-04 21:45:42 -04:00
Bill Hollings
6374d9d29b Fix visionOS build errors and warnings where possible.
- Remove visionOS from multi-platform builds because it
  requires Xcode 15+ and will abort a multi-platform build.
- Define TARGET_OS_XR for older SDK's.
- A number of SDK deprecation warnings remain when building for visionOS.
  These cannot be removed without significant refactoring.
- Build visionOS dependencies for Release build by default.
- Fix local variable initialization warning (unrelated).
2023-07-11 15:43:41 -04:00
Bill Hollings
855c7a6c36 Merge branch 'visionOS' of https://github.com/nginetechnologies/MoltenVK into nginetechnologies-visionOS 2023-07-11 10:58:46 -04:00
Antarctic Coder
6bca44c612 Added MSL Version 3.1 for switch case
In this commit, I've added support for Xcode 15, and added a case for MSL version 3.1. I added this because I noticed xcode was throwing some warnings about an unhandled switch case.
2023-07-05 09:47:38 -04:00
Filip Lundgren
a756b8cd6e Fix MVK_MACOS_OR_IOS_OR_VISIONOS check 2023-06-23 10:31:22 -04:00
Filip Lundgren
d8b5a7df55 Merge branch 'main' of https://github.com/KhronosGroup/MoltenVK into visionOS 2023-06-23 10:29:57 -04:00
Filip Lundgren
16990efeb1 Support building for visionOS
Note: Internal naming is xrOS, but publicly it should be referred to as visionOS
2023-06-23 10:25:05 -04:00
Bill Hollings
5092330273 Support BC compression on iOS/tvOS, where available.
- Add MVK_XCODE_14_3 macro to compile for iOS/tvOS 16.4 and above.
- Add support for BC compression on iOS/tvOS 16.4 and above where supported.
- Consolidate MVKPixelFormats::modifyMTLFormatCapabilities(mtlDev)
  and centralize querying MTLDevice format methods for all platforms.
2023-04-12 11:50:09 -04:00
Bill Hollings
12592abbc9 Update copyright notices to year 2023. 2023-01-13 12:19:37 -05:00
Bill Hollings
682906976d Fix linking issues with dynamic Vulkan functions.
- Ensure Vulkan public symbols are not stripped from the library when
  statically linked to an app that calls all Vulkan functions dynamically.
- Per Vulkan 1.2 spec, support calling vkGetInstanceProcAddr() with a
  null instance, when vkGetInstanceProcAddr itself is the function name.
- Replace uses of strcmp() with mvkStringsAreEqual() to protect against
  null pointers, and provide a direct bool output (unrelated cleanup).
2023-01-10 07:22:05 -05:00
sean
83c0ca60fb
Add support for KHR_buffer_device_address 2022-06-16 17:32:25 +02:00
Nikita Fediuchin
4efb90b3c1 Update license year 2022-02-04 13:33:27 +02:00
Bill Hollings
52568efb27 Optionally hide additional static Vulkan linkage symbols.
Move the aliasing of promoted function pointers to the function pointer
lookup collection, because non-global function alias symbols are not
available in separately compiled object file.

Add public aliased Vulkan extension functions that were promoted to 1.1 to
the public symbols that are hidden when MVK_HIDE_VULKAN_SYMBOLS is enabled.

Add functions from the private VK_MVK_moltenvk extension that depend on
Vulkan object handles to the public symbols that are hidden when
MVK_HIDE_VULKAN_SYMBOLS is enabled, to discourage their use by apps that
are using the Vulkan Loader and Layers, because they are not supported by
the Vulkan Loader and Layers.

Update VK_MVK_MOLTENVK_SPEC_VERSION to version 33.
2021-12-18 14:00:37 -05:00
Bill Hollings
5de7f5551c Support building MoltenVK with static Vulkan linkage symbols hidden.
Add build environment variable MVK_HIDE_VULKAN_SYMBOLS. to allow MoltenVK
to be built with static Vulkan API symbols hidden, to avoid library linking
conflicts when bound to a Vulkan Loader that also exports identical symbols.

The default value of MVK_HIDE_VULKAN_SYMBOLS is 0,
meaning Vulkan static symbols are exposed by default.

Add MVK_PUBLIC_VULKAN_SYMBOL directive to mark each Vulkan call symbols
for exporting or hiding.

Update the MoltenVK Xcode project to add the MVK_HIDE_VULKAN_SYMBOLS build
setting, and set the ENABLE_TESTABILITY build setting to NO, because it
conflicts with stripping symbols.

Update MoltenVK version to 1.1.7.
2021-11-17 18:22:33 -05:00
Bill Hollings
6b502bcb60 Upgrade projects to Xcode 13 SDK APIs.
Add MVK_XCODE_13 code macro.
Support MTLLanguageVersion2_4 enum value.
MoltenVKPackaging project add DISABLE_MANUAL_TARGET_ORDER_BUILD_WARNING
build setting to suppress build warnings about using manual build orders.
2021-06-14 16:24:32 -04:00
Bill Hollings
4675481a06 Redefine derivations of MVK_APPLE_SILICON, MVK_MACOS_APPLE_SILICON, and MVK_XCODE_12.
Derive MVK_APPLE_SILICON from target CPU.
Derive MVK_MACOS_APPLE_SILICON from target CPU and macOS platform.
Derive MVK_XCODE_12 from macOS and iOS SDK versions.
Test for simulator on non-Apple GPU using MVK_OS_SIMULATOR && !MVK_APPLE_SILICON.
2021-02-20 09:33:32 -05:00
Bill Hollings
e1b3585413 Add MVK_APPLE_SILICON macro definition.
Use MVK_APPLE_SILICON instead of
MVK_IOS_OR_TVOS || MVK_MACOS_APPLE_SILICON or
MVK_MACOS_APPLE_SILICON || MVK_IOS_OR_TVOS.
2021-01-21 16:53:17 -05:00
Bill Hollings
015031c955 Update copyright notices to year 2021 and Xcode build settings check to Xcode 12.3. 2021-01-21 13:37:07 -05:00
Bill Hollings
1ec58c9a92 Support building for Mac Catalyst on macOS 11.0+.
Define MVK_MACCAT build macro and use it to conditionally compile code to align
with build features and capabilities of Mac Catalyst platform on macOS 11.0+.
Treat Mac Catalyst as minor variation of macOS 11.0.
Update documentation.

Currently only support Mac Catalyst on macOS 11.0+, to avoid complexities of
deselecting iOS features and capabilities for Mac Catalyst on previous macOS versions.

Mac Catalyst (and Simulators) require use of XCFrameworks.
Currently unable to generate a dylib for Mac Catalyst.
2020-12-01 19:26:15 -05:00
Chip Davis
d73017f4db MVKDevice: Set properties for Apple Silicon GPUs on macOS. 2020-10-28 19:35:24 -05:00
Chip Davis
2c40e39699 Fix aliases on ARM64.
The semicolon is the comment character in ARM64 assembly. Just put the
alias symbol definition on another line.
2020-09-10 20:21:02 -05:00
Chip Davis
78963db6cc Export core names of Vulkan 1.1 calls promoted from extensions.
The functions are now defined under their core names. To avoid code
bloat, I've defined the suffixed names as aliases of the core names.
Both symbols will be globally defined with the same value, and in the
dylib both will be exported.

Fix the default API version when none is given. Zero is the same as
`VK_API_VERSION_1_0`. Prior to this, we were overwriting it with zero if
no app info were given, or if it were zero in the app info. It wasn't
important before, but now that we gate API availability on maximum
Vulkan version, we need to make sure it's a valid version.
2020-09-08 13:22:17 -05:00
Bill Hollings
72c4ba1118 Remove unneeded MVK_IOS_SIMULATOR and MVK_TVOS_SIMULATOR macros. 2020-07-17 22:18:08 -04:00
Bill Hollings
40d3485cec Remove unneeded switch default for MTLLanguageVersion.
Minor doc fixes from PR review.
2020-06-24 17:04:30 -04:00
Bill Hollings
7910f43867 MVKPixelFormats reduce some MTLPixelFormat capabilities for simulators.
Add MVK_IOS_SIMULATOR and MVK_TVOS_SIMULATOR macros.
MVKPixelFormats add disableMTLPixelFormatCapabilities().
MVKPixelFormats add disableAllMTLPixelFormatCapabilities().
2020-06-22 23:52:51 -04:00
Bill Hollings
37e8e3182c Redefine MoltenVK platform macros in terms of newer Apple target conditionals. 2020-06-22 21:37:30 -04:00
Aman Gupta
7392e23db2 unncessary change in the diff 2020-06-17 10:30:41 -07:00
Aman Gupta
9694169da6 split out MVK_IOS_OR_TVOS 2020-06-15 16:36:05 -07:00
Aman Gupta
b250212c6f add MVK_TVOS and start conditionalizing build failures 2020-06-15 16:21:13 -07:00
Bill Hollings
8ec682938b Update copyright to 2020. 2020-01-07 16:47:29 -05:00
Bill Hollings
fe55930fd5 Update Brenwill copyright noticies to 2019. 2019-01-01 21:13:25 -05:00
Bill Hollings
86bb51554b Support IOSurface on iOS only if IPHONEOS_DEPLOYMENT_TARGET is at least iOS 11.0.
On iOS, only compile IOSurface support, and link IOSurface framework to
libMoltenVK.dylib, if IPHONEOS_DEPLOYMENT_TARGET is at least iOS 11.0.
Update to latest version of SPIRV-Cross.
Update MoltenVK version to 1.0.15.
2018-07-12 18:26:54 -04:00
Bill Hollings
98b050e6e2 Update copyright dates to 2018. 2018-01-31 16:57:59 -05:00
Bill Hollings
fd7b8234f9 Initial open-source commit. 2017-11-17 11:14:29 -05:00