It is always legal in Vulkan to read a builtin, particularly
`BuiltInPosition`, even if it weren't written by the previous stage. The
CTS tests that this scenario works in the driver.
Update SPIRV-Cross to pull in a change required for this.
Fixes 8 CTS tests under `dEQP-VK.pipeline.*.no_position`. (Eight other
tests worked solely by accident without this change.)
- Support option to use MTLEvents for Vulkan semaphores on NVIDIA and Rosetta2.
- Add public MVKVkSemaphoreSupportStyle enumeration.
- MVKConfiguration replace deprecated legacy booleans semaphoreUseMTLEvent,
and semaphoreUseMTLFence with enumerated semaphoreSupportStyle.
- Alias legacy semaphoreUseMTLEvent to semaphoreSupportStyle and support legacy
use of semaphoreUseMTLFence and semaphoreUseMTLEvent for backwards compatibility.
- MVKConfiguration rename recently renamed semaphoreUseSingleQueue back to
semaphoreUseMTLFence for backwards compatibility.
VK_EXT_descriptor_indexing extension is enabled.
- Change MVKConfiguration::useMetalArgumentBuffers to enum instead of boolean
and default to enabling Metal argument buffers for VK_EXT_descriptor_indexing.
- Leave Metal argument buffers disabled by default until they are improved.
- Enable VkPhysicalDeviceVulkan12Features::descriptorIndexing.
- Add MVKPhysicalDeviceVulkan12FeaturesNoExt to track and enable Vulkan 1.2
features not part of any prior extensions absorbed by Vulkan 1.2.
- Update VK_MVK_MOLTENVK_SPEC_VERSION to version `36`.
- MVKDeviceTrackingMixin remove unnecessary inline declarations.
- MoltenShaderConveter tool support Metal Argument Buffers and MSL 3.0.
Vulkan 1.2 includes several optional extensions that are not currently
supported by Metal. These include:
- VK_KHR_draw_indirect_count (and VK_AMD_draw_indirect_count)
- VK_KHR_shader_atomic_int64
- VK_KHR_vulkan_memory_model
- VK_EXT_sampler_filter_minmax
Capability flags for these extensions are included in
VkPhysicalDeviceVulkan12Features and VkPhysicalDeviceVulkan12Properties,
and in parallell extension-specific structures.
This addition provides no new user functionality. For consistency with
VkPhysicalDeviceVulkan12Features and VkPhysicalDeviceVulkan12Properties,
the changes here flush out the extension/Vulkan 1.2 parallel functionality,
with a view to prepare to include the functionality consistently in both
an extension and Vulkan 1.2, should the functionality become available
in a future version of Metal.
This change also explicitly includes the optional extensions in
MVKExtensions.def, but disables them from user visibility.
- Enable shaderSignedZeroInfNanPreserveFloat16 and
shaderSignedZeroInfNanPreserveFloat32.
Other float control properties are not settable in Metal.
- MVKShaderModule log whether compiling with fast math enabled.
- Update MoltenVK_Runtime_UserGuide.md and Whats_New.md documents.
- runcts script enable MVK_CONFIG_FAST_MATH_ENABLED by default.
When presenting drawables in the future, the MVKPresentableSwapchainImage
and MVKSwapchain were both being retained by the drawable-presented callback,
so that the presentation timing info can be recorded on the swapchain.
Unfortunately, in the case where the presentation timing is set far enough
into the future (I'm looking at you CTS), the swapchain, and even the
CAMetalLayer's view may be destroyed, causing occasional bad access crashes.
- MVKSwapchainImage don't retain() the swapchain, and move clearing the
swapchain from the destructor to destroy(), so the MVKSwapchain is not
necessarily retained by the MVKSwapchainImage, for a drawable being
presented in the future.
- MVKSwapchainImage add a lock around clearing swapchain and accessing
it from callbacks.
- Add lockable releaseLayer() function in both MVKSwapchain and MVKSurface,
which is called from both layer observer and destructor, to handle race
conditions better.
- MVKSwapchain::initCAMetalLayer() call MVKSurface::getCAMetalLayer() only once.
- Update MoltenVK version to 1.1.12.
- Update What's New document.
- MVKPushConstantsCommandEncoderState move marking descriptor buffer
binding override from markDirty() to encodeImpl().
- MVKCommandEncoder::setXXXBytes() calls optionally mark overridden descriptor
buffer bindings as dirty, allowing this functionality to be generalized.
- MVKMTLBufferBinding::update() inline buffers never update just offset
because inline contents may have changed.
- MVKCmdClearAttachments mark specific overridden buffer bindings dirty
instead of marking entire MVKGraphicsResourcesCommandEncoderState dirty.
- MVKResourcesCommandEncoderState::bind() don't mark entire
MVKResourcesCommandEncoderState dirty unless the binding
itself was marked dirty (unrelated optimization).
- Rename markPushConstantBinding() to markBufferIndexDirty().
This fixes an earlier regression, where when only the offset changes in
a buffer descriptor, the binding is not marked dirty if the same Metal
binding index is used by a push constant in between descriptor bindings.
- MVKPushConstantsCommandEncoderState::markDirty() call resource encoder
state markPushConstantBinding() to find and mark dirty descriptor that
uses same Metal index as a push constant binding.
- Add MVKResourcesCommandEncoderState::markMetalBufferIndexDirty() to
find and mark dirty a descriptor buffer binding that uses
- MVKResourcesCommandEncoderState::bind() use range-based-for-loop
for consistency (unrelated).
- MVKDescriptorPool::reset() don't waste time freeing
descriptor sets that were never allocated.
- If descriptor set could not be allocated, set availability bit (unrelated).
- MVKBitArray add _lowestNeverClearedBitIndex to track the lowest bit index
that has not been cleared since last reset.
- MVKBitArray rename _minUnclearedSectionIndex to _clearedSectionCount for clarity.
- MVKBitArray use _clearedSectionCount and _lowestNeverClearedBitIndex to optimize
operation of setting or clearing all bits.
- MVKBitArray::setBit() ensure we don't try to change a bit that is out of range.
- MVKBitArray::resize() no-op if size doesn't actually change.
- MVKQueue don't include object pointer in error log, so CTS log results
are consistent across multiple CTS runs (unrelated).
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.