Move tracking descriptor index to MVKDescriptorSetLayoutBinding from MVKDescriptorSetLayout.
Refactor MVKDescriptorSet::write() to be more DRY.
Grow and shrink MVKDescriptorSet memory consumption during allocate and free.
MVKPhysicalDevice refactor layout of pipelineCacheUUID to remove redundancy in MoltenVK
revision and allow tracking of enabled features that affect pipeline cache content.
MVKBitArray support resizing and simplify setBit() functionality.
The test for single-texel capability used a mod calculation to compare the linear
alignment requirement reported by Metal to the texel size. Instead, it should use an
inequality comparison, to check if the alignment requirement is LTE the texel size.
Enable MVKConfiguration::preallocateDescriptors and
MVK_CONFIG_PREALLOCATE_DESCRIPTORS by default.
Rename MVKDescriptorTypePreallocation to MVKDescriptorTypePool.
Don't free individual pooled descriptors during a pool reset.
Don't mark availability of individual descriptor sets during a pool reset.
Add MVKDescriptorPool::_hasPooledDescriptors as SVOT to track if descriptors
are pooled, and is set from outside constructor to ensure all internal
descriptor pools are constructed with the same SVOT.
MVKDescriptorPool::allocateDescriptorSet() ensure correct result returned.
Remove MVKDescriptor::setLayout() and pass MVKDescriptorSetLayoutBinding
to MVKDescriptor::bind(), write(), and read().
Remove MVKSamplerDescriptorMixin::_hasDynamicSampler.
Remove MVKInlineUniformBlockDescriptor::_length.
For memoryless attachments, setting renderpass load and store
actions to "load" and "store" triggers Metal validation errors.
Refactor determination of renderpass MTLLoadAction and MTLStoreAction.
For memoryless attachments, replace load with don't care,
and store with resolve or don't care.
Don't assume the incoming CAMetalLayer has default (no-op) values for colorspace and
wantsExtendedDynamicRangeContent properties, since they could have been set externally.
Ensure the Vulkan app has control over both of these properties.
vkCreateSwapchainKHR() returns VK_ERROR_FORMAT_NOT_SUPPORTED for unsupported colorspaces.
Restore support for VK_COLOR_SPACE_HDR10_HLG_EXT and VK_COLOR_SPACE_HDR10_ST2084_EXT
under Xcode12 that was removed due to App Store conflicts using older enum values.
Fix MVKPhysicalDevice::getSurfaceFormats() returning VK_FORMAT_UNDEFINED
in available surface formats when a Metal surface format is available that
doesn't map to a defined Vulkan format (eg. MTLPixelFormatBGRA10_XR).
MVKConfigLogLevel, MVKConfigTraceVulkanCalls, and MVKConfigAutoGPUCaptureScope
do not need to be VkFlags, since they aren't bitwise flags.
MVK_SET_FROM_ENV_OR_BUILD_INT32 supports setting enumerated values.
Introduce MVKConfigLogLevelBits enum to specify values of
MVKConfiguration::logLevel in a Vulkan-friendly manner,
while automatically documenting the same values for env vars.
Introduce MVKConfigTraceVulkanCallsBits enum to specify values of
MVKConfiguration::traceVulkanCalls in a Vulkan-friendly manner,
while automatically documenting the same values for env vars.
MVKConfiguration::defaultGPUCaptureScopeQueueFamilyIndex
and defaultGPUCaptureScopeQueueIndex.
Introduce MVKConfigAutoGPUCaptureScopeBits enum to specify values of
MVKConfiguration::autoGPUCaptureScope in a Vulkan-friendly manner,
while automatically documenting the same values for env vars.
Update some config documentation.
Introduce MVKConfigAdvertiseExtensionBits enum to specify multiple API config values in
a Vulkan-friendly manner, while automatically documenting the same values for env vars.
External libraries in particular make liberal use of assert() calls, which bypass
error catching, sometimes causing crashes rather than catch errors and moving on.
Remove SPIRV-Cross/ qualifier from include references to SPIRV-Cross header files.
Remove glslang/ qualifier from include references to glslang header files.
This change allows easier integration with app build scripts.
When mvkGetMVKConfiguration()->advertiseExtensions is disabled, and MoltenVK
artificially advertises that all extensions are not supported, allow the functions
of those extensions to be called anyway.
Some CTS tests are structured to assume one or more basic extensions are supported,
and do not bother checking for those extensions and provide alternate code paths
based on the extension not being supported. Permitting the calls to be made anyway
allows those tests to proceed and avoid crashing.
Fixes to MVKQueueCommandBufferSubmission:
- Consolidate MTLCommandBuffer completion callbacks, and ensure all other activities,
including logging, which references the object, occurs before finish() is called.
- Remove separate flag that indicates whether to track MTLCommandBuffer completion times.
- Localize Vulkan error reporting to the queue instead of the device.
If we're on macOS 11 or iOS/tvOS 14, and debug mode (`MVK_DEBUG=1`) were
enabled, then we'll enable enhanced command buffer errors, which give us
more information about which encoder triggered the error. We'll also
print log messages from shader validation.
Always advertise VK_KHR_portability_subset. Advertise other extensions only if
MVKConfiguration::advertiseExtensions enabled and extension available on platform.
Reorganize and simplify checking extension platform availability.
Add MVKConfiguration::apiVersionToAdvertise and MVK_CONFIG_API_VERSION_TO_ADVERTISE
env var to configure MoltenVK to advertise a particular Vulkan version.
Advertise MVKConfiguration::apiVersionToAdvertise in:
vkEnumerateInstanceVersion()
vkGetPhysicalDeviceProperties()
vkEnumerateInstanceLayerProperties()
vkEnumerateDeviceLayerProperties()
Add MVKConfiguration::advertiseExtensions and MVK_CONFIG_ADVERTISE_EXTENSIONS
env var to configure MoltenVK to not advertise support for any Vulkan extensions.
Refactor population of MVKConfiguration from environment variables to better
support validating and baking config values set by app.
Update MoltenVK version to 1.1.3.
Update VK_MVK_MOLTENVK_SPEC_VERSION to 31.
Some buffers, particularly those used by tessellation, indirect
multiview, or occlusion queries, are never written or read from the
host. Keeping the relevant data in VRAM should improve performance by
reducing the need for the GPU to make expensive accesses over the PCI
bus.
VRAM is a scarce resource on discrete GPUs, but this is part of why we
marked the buffers volatile.
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.
MTLDevice retains an internal object web that is used during the creation of
new objects, such as pipeline states, libraries, functions, and samplers.
Simultaneously creating and destroying objects of these types can trigger
race conditions on the internal MTLDevice content.
Wrap the following in @synchronized (mtlDevice) {...}:
- MTLRenderPipelineState creation and destruction
- MTLComputePipelineState creation and destruction
- MTLLibrary creation
- MTLFunction creation and specialization
- MTLSampler creation and destruction
MVKCommandEncoderState has numerous subclasses, and the polymorphic
MVKCommandEncoderState::resetImpl() requires significant maintenance
across these subclasses. It's only use was in disabling depth-stencil state.
Remove MVKCommandEncoderState::reset() and all implementations of resetImpl()
across all MVKCommandEncoderState subclasses.
Remove MVKPipeline::__hasDepthStencilInfo and disable depth-stencil state
automatically via cleared Vulkan struct in MVKPipeline.
Don't reset MVKOcclusionQueryCommandEncoderState::_mtlVisibilityResultOffset
when ending occlusion query, as subsequent queries need different offsets.
Also, remove MVKOcclusionQueryCommandEncoderState::_needsVisibilityResultMTLBuffer,
as it is always set once from MVKCommandBuffer::_needsVisibilityResultMTLBuffer.
When app setting MVKConfiguration it with a partial copy, start with existing.
It is possible for the maximum buffer size to be 4 binary gigabytes or
greater. In that case, the upper 32 bits will be lost, and the value of
the `maxUniformBufferRange` and `maxStorageBufferRange` limits would be
too small or even zero. Clamp it to 4 GiB - 1 in that case, since that
is the maximum value of a 32-bit integer.
For #1240.
Refactor auto GPU capture code to support both device and frame capture.
Add ability to automatically capture first GPU frame by setting
`MVK_CONFIG_AUTO_GPU_CAPTURE_SCOPE` to `2`.
Wrap GPU capture in autorelease pool to handle both cases of capture call
being made in run loop as in an app GUI, or in one-shot app like CTS.