In preparation for Vulkan 1.2, support the following device feature
and property structures, and use them to populate the corresponding
device feature and property values originally supplied by Vulkan
extensions, to ensure a single source of truth for these values:
- VkPhysicalDeviceVulkan11Features
- VkPhysicalDeviceVulkan11Properties
- VkPhysicalDeviceVulkan12Features
- VkPhysicalDeviceVulkan12Properties
Disable VkPhysicalDeviceVulkan12Features::drawIndirectCount and
VkPhysicalDeviceVulkan12Features::samplerFilterMinmax, to indicate that
Vulkan 1.2 support will not include extensions VK_KHR_draw_indirect_count
and VK_EXT_sampler_filter_minmax, respectively.
Support enabling device features during VkDevice creation using
VkPhysicalDeviceVulkan11Features and VkPhysicalDeviceVulkan12Features.
- Add MVKDeviceFeatureStructs.def file to describe each device feature
struct, and define, populate, and manage MVKDevice device feature
tracking iVars using the list in this file.
- Reorder switch cases in MVKPhysicalDevice::getFeatures() to match the
list in MVKDeviceFeatureStructs.def.
- Where possible, remove extension suffixes from device feature structs
and associated VkStructureType values.
- Remove const qualifier from device feature enabling structs.
- Add [CAMetalLayer screenMVK] extension method to retrieve screen.
- If the layer has a delegate view, use it to locate the screen, otherwise
revert to iterating across windows, looking for the CAMetalLayer, to identify
the window the layer is in, from which to retrieve the screen.
- Fix the iteration of the layer hierarchy, to accommodate that Apple may
add superlayers to the CAMetalLayer under the covers.
- Update MoltenVK_Runtime_UserGuide.md to encourage the app to ensure the view
is the delegate of the CAMetalLayer, to more efficiently access the screen.
- DemoView implements NSViewLayerContentScaleDelegate protocol to update
[CAMetalLayer contentsScale] property when moved between screens.
- Log contentsScale value during swapchain creation.
- Remove a few unnecessary inline declarations.
When checking query wait completion, all queries were previously
checked for Available status, and blocked until all became Available.
However, only queries that were encoded to be written should be checked.
It is okay for queries that are not encoded to be written to remain in
Initial state, and not block the wait.
Support by the MTLDevice for Metal Tier 2 argument buffers has an
impact on both descriptor indexing and buffer device address support.
Add MVKPhysicalDeviceMetalFeatures::argumentBuffersTier, to track
the MTLDevice argument buffers support tier, set it from
[MTLDevice argumentBuffersSupport], and subsequently enable support for
VK_KHR_buffer_device_address and VK_EXT_buffer_device_address extensions,
and set descriptor indexing resource counts, based on it.
Update documentation requirements.
Add MVKPhysicalDeviceMetalFeatures::shaderBarycentricCoordinates,
enable it based on [MTLDevice supportsShaderBarycentricCoordinates],
and subsequently enable support for VK_KHR_fragment_shader_barycentric
and VK_NV_fragment_shader_barycentric extensions, based on it.
- vkCreateSemaphore() create binary semaphore, unless timeline explicitly
requested. Previously, timeline semaphore was always created when
exportObjectType == VK_EXPORT_METAL_OBJECT_TYPE_METAL_SHARED_EVENT_BIT_EXT.
- vkCreateSemaphore() record error when MTLSharedEvent imported or marked for
export, and MoltenVK configured for VkSemaphore using MTLFence or CPU emulation.
- MVKTimelineSemaphore elide unused constructor arguments.
Creating an empty MVKDescriptorSet will read this member and tip off undefined
behavior sanitizer. It shouldn't actually cause any bugs, but with UB you never
know.
- Update to latest SPIRV-Cross to support `SPV_KHR_physical_storage_buffer`
for `VK_KHR_buffer_device_address` and `VK_EXT_buffer_device_address`
- Add support for `VK_EXT_buffer_device_address` extension.
- Advertise support for `VK_KHR_buffer_device_address`
and `VK_EXT_buffer_device_address` on macOS 12.5.
- Add appropriate extension reporting and enablement for
`VkPhysicalDeviceBufferDeviceAddressFeatures`,
`VkPhysicalDeviceBufferDeviceAddressFeaturesEXT`, and
`VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR`.
- Support reading `VkMemoryAllocateFlagsInfo` to identify memory allocations that
need to support buffer pointer access (in case needed in future on non-shared memory).
- Update `Whats_New.md` and `MoltenVK_Runtime_UserGuide` documents.
- Replace use of deprecated kIOMasterPortDefault with MACH_PORT_NULL.
- Convert an inline VLA with constant length array.
- Add input files to all build phases to trigger dependencies when inputs change.
- Add packaging scripts to per-platform ExternalDependencies targets.
Add dummy output files to each Xcode Run Script build phase that doesn't
already have dependencies set, to avoid setting alwaysOutOfDate flag
(by disabling "Based on dependency analysis" UI flag), which forces
the Xcode project to a version that can't be read by Xcode 11.7.
- Update minimum Xcode deployment targets to macOS 10.13, iOS 11, and tvOS 11,
to avoid Xcode build warnings.
- Add support for MTLLanguageVersion3_0 enumeration.
- Build efficiencies:
- Build scripts create_dylib.sh and gen_moltenvk_rev_hdr.sh
only run if build dependencies require it.
- Packaging and copy_to_staging.sh scripts are too complex to define dependencies,
and are fast, so configured to run every time, to avoid build warning.
- Replace use of deprecated sprintf() with snprintf().
- Replace use of deprecated kIOMasterPortDefault with kIOMainPortDefault.
- Support old-style GPU debug capture only if building for earlier minimum
deployment targets, to avoid deprecation warning.
- Update minimum Xcode deployment targets of Cube demo to macOS 10.14, iOS 12,
and tvOS 12, to avoid Xcode build warning regarding MTLSharedEvent in .
- Update README.md document regarding minimum Xcode deployment targets.