- Cleanup VkPhysicalDeviceShaderAtomicFloatFeaturesEXT enablement and documentation.
- Cleanup VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT enablement.
- Expand MVK_CONFIG_TRACE_VULKAN_CALLS to log thread ID only if requested.
- Add MVKCompressor template class, and mvkCompress() & mvkDecompress()
functions to support general data compression.
- Add MVKConfiguration::shaderSourceCompressionAlgorithm and
env var MVK_CONFIG_SHADER_COMPRESSION_ALGORITHM to support
compressing MSL shader source code held in a pipeline cache.
- Add MVKShaderCompilationPerformance::mslCompress and mslDecompress
to allow performance of MSL compression to be tracked and queried.
- Add support for logging performance stats accumulated in a VkDevice,
when it is destroyed. Good for CTS testing.
- Change MVKConfiguration::logActivityPerformanceInline boolean to
activityPerformanceLoggingStyle enumeration value.
- Add MVK_CONFIG_ACTIVITY_PERFORMANCE_LOGGING_STYLE environment variable and
build setting to set MVKConfiguration::activityPerformanceLoggingStyle value.
- Don't retain converted MSL source code in MVKShaderModule.
- Add SPIRVToMSLConversionResult and GLSLToSPIRVConversionResult
structures to capture all feedback from shader conversions.
- Fix crash when VkCommandBufferInheritanceInfo::renderPass is VK_NULL_HANDLE.
- Do not clear attachments when dynamic rendering is resumed.
- Allow ending dynamic rendering to trigger next multiview pass if needed.
- Move deciding to begin next multiview pass to MVKCommandEncoder.
- Fix premature caching of occlusion query results during tessellation rendering.
Tessellation ends Metal renderpass for compute control and eval stages.
Wait until end of Metal renderpass after rasterization stage.
- vkCmdCopyQueryPoolResults(): Fix loss of queries when query
count is not a multiple of GPU threadgroup execution width.
- Disable occlusion recording while clearing attachments or render area.
- MVKCmdClearAttachments improve labelling of MTLDebugGroup to better
distinguish clearing renderpass render area from vkCmdClearAttachments()
in an Xcode GPU capture (unrelated but helpful during debugging).
- MVKCmdClearAttachments re-order member variables to
optimize memory requirements (unrelated).
- MVKCommandBuffer remove unused renderpass tracking functions (unrelated).
- 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.
- Redefine enumeration values of MVKPrefillMetalCommandBuffersStyle.
- Add option to defer encoding prefilled MTLCommandBuffer to queue submission.
- Remove option to create an autorelease pool in the MVKCommandEncoder
to span immediate command encodings, because it causes crashes when
multiple command buffers were overlapping prefilling on the same thread.
- Replace MTLCommandEncoder retain/release macros with template member functions.
- Rename MVKCommandPool::newMTLCommandBuffer() to getMTLCommandBuffer()
and do not retain the returned MTLCommandBuffer (unrelated).
- Revert MoltenVK logging to use stderr instead of stdout (unrelated).
- Merge branch from master.
- Add MVKPrefillMetalCommandBuffersStyle enumeration to enable prefilling,
and configure memory recovery options.
- Redefine MVKConfiguration::prefillMetalCommandBuffers as a value from
MVKPrefillMetalCommandBuffersStyle instead of a simple boolean. Set the
values of MVKPrefillMetalCommandBuffersStyle and the default value of
MVKConfiguration::prefillMetalCommandBuffers to be compatible with
legacy use of this setting as a simple enable/disable boolean value.
- MVKCommandEncoder track prefill style, and support option to maintain
a Metal autorelease pool that is created on vkBeginCommandBuffer()
and drained on vkEndCommandBuffer(), when prefiling a command buffer
from a single thread, and an option to wrap each command addition in
a separate @autoreleasepool{} scope to create and drain an autorelease
pool at every command addition to the Vulkan command buffer, when
prefilling a single command buffer from multiple threads.
- MVKCommandEncoder retain Metal encoders when prefilling, because
prefilling may span multiple autorelease pools.
- MVKCommandEncoder clean up memory leak of MTLBlitPassDescriptor
during prefilling.
- MVKCommandEncoder rearrange declarations of MVKCommandUse member
variables to tighten up class memory use (unrelated).
- MVKCommandBuffer remove unnecessary inline declarations (unrelated).
- Change MoltenVK logging to use stdout instead of stderr (unrelated).
- Set MVK_VULKAN_API_VERSION from VK_API_VERSION_1_2.
- Update MoltenVK version to 1.2.0.
- Remove several previously overlooked extension suffixes
in use of promoted Vulkan struct and enum values.
- Update documentation.
when building with MVK_HIDE_VULKAN_SYMBOLS=1.
Alias vkGetBufferDeviceAddressEXT to core function,
and add it as promoted extension function in MVKInstance.
- 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.
- 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.
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).
- 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.