- Revert mvkRoundHalfToEven() to static inline instead of constexpr,
because internal use of std::remainder() is not constexpr until C++23.
- Replace non-template constexpr functions with static constexpr.
- Update Github CI to default to use Xcode 14.2,
and macos-latest (which is now macos-12).
- Add mvkGetNaturalExtent() to consolidate retrieving the natural rounded
extent of the CAMetalDrawables that will be created by a CAMetalLayer,
based on its drawableSize and contentsScale properties.
- Replace MVKSwapchain::_mtlLayerDrawableSize with _mtlLayerDrawableExtent.
- MVKSwapchain::hasOptimalSurface() compares last, actual,
and natural rounded drawable extents of CAMetalLayer.
- Pass MVKImagePresentInfo struct by reference instead of copy.
- Remove unused boolean to pass around
VK_SWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_EXT status.
- Support querying scaling capabilities and present mode compatibilies
when querying surface capabilities.
- Rename MVKPresentTimingInfo to MVKImagePresentInfo and add present mode
and fence to support dynamic present mode changes and fence signaling.
- MVKPresentableSwapchainImage remove static functions from class declaration.
- MVKSwapchain support releasing swapchain images on command.
- MVKSwapchain support configuring with scaling and gravity info, apply it to
CAMetalLayer.and do not return VK_SUBOPTIMAL_KHR if swapchain was configured
with scaling info.
- Rename MVKSwapchain::acquireNextImageKHR to acquireNextImage.
- CAMetalLayer naturalDrawableSizeMVK compute precise drawable size.
- CAMetalLayer remove obsolete and unused updatedDrawableSizeMVK method.
- Rename MVKConfiguration::swapchainMagFilterUseNearest to
swapchainMinMagFilterUseNearest to apply CAMetalLayer size
filtering to both magnification and minification, and rename
corresponding env var MVK_CONFIG_SWAPCHAIN_MAG_FILTER_USE_NEAREST
to MVK_CONFIG_SWAPCHAIN_MIN_MAG_FILTER_USE_NEAREST.
- Detect when size of surface has changed under the covers.
- Change rounding of surface size provided by Metal from truncation to
rounding-with-half-to-even.
- Remove MVKLogSizeOf() logging macro as redundant to mvkPrintSizeOf() macro.
- Update maxClipDistances and maxCombinedClipAndCullDistances to more accurate values.
- Update maxDrawIndexedIndexValue to acknowledge primitive restart.
- 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).
- Fix Metal validation error caused by CAMetalDrawable released before
MTLCommandBuffer is finished using it.
- When presenting, MVKPresentableSwapchainImage retains in-flight
CAMetalDrawable until MTLCommandBuffer completion.
- Fix memory leak of MVKFences and MVKSemaphores when a
swapchain image is acquired more than it is presented.
- Force MVKPresentableSwapchainImage to untrack any tracked fences or
semaphores when it is destroyed.
- Update MoltenVK version to 1.2.2.
Metal uses MTLRenderPassDescriptor properties renderTargetWidth,
renderTargetHeight, and renderTargetArrayLength to preallocate tile memory
storage on machines using tiled rendering. This memory preallocation is not
necessary if we are not rendering to attachments, and some apps actively
define extremely oversized framebuffers when they know they are not rendering
to actual attachments, making this internal tile memory allocation even more
wasteful, occasionally to the point of triggering OOM crashes.
Update MoltenVK version to 1.2.2.
of VK_KHR_shader_float_controls.
The introduction of shaderSignedZeroInfNanPreserveFloat32 was causing Metal
fast math to be aggressively disabled by the use of SignedZeroInfNanPreserve
in shaders in some apps, causing a regression in shader performance in those apps.
- Change MVKConfiguration::fastMathEnabled from bool to enumeration to distinguish
between always using fast math or allowing shaders to selectively disable it.
- Default value to fast math always.
Push constants and attachment clearing can temporarily override Metal buffer
bindings for descriptor sets and vertex attributes. Mark the overridden buffer
bindings and ensure they are reinstated when the pipeline is updated.
- Add MVKMTLBufferBinding::isOverridden to track if buffer binding is
temporarily overridden.
- Rename MVKResourcesCommandEncoderState::markIndexDirty()
to markBufferIndexOverridden() to mark buffer bindings as overridden.
- Rename MVKGraphicsResourcesCommandEncoderState::markBufferIndexDirty()
to markBufferIndexOverridden().
- Rename MVKComputeResourcesCommandEncoderState::markBufferIndexDirty()
to markBufferIndexOverridden().
- Add MVKResourcesCommandEncoderState::markOverriddenBufferIndexesDirty()
to mark overridden buffer bindings as dirty.
- Add MVKGraphicsResourcesCommandEncoderState::markOverriddenBufferIndexesDirty()
and call when render pipeline change is encoded
- Add MVKComputeResourcesCommandEncoderState::markOverriddenBufferIndexesDirty()
and call when compute pipeline change is encoded.