- Expose MTLRenderPipelineDescriptor.sampleMaskMVK and
MTLSamplerDescriptor.lodBiasMVK properties when
MVK_USE_METAL_PRIVATE_API build setting is disabled.
- MVKCmdSetDepthBias & MVKCmdSetDepthBounds subclass from MVKSingleValueCommand.
- MVKRenderingCommandEncoderState simplify calls to set depth bias
and depth bounds, and make consistent with other settings.
- Refactor MVKRenderingCommandEncoderState::setContent() and
setMTLContent() to remove need for intermediate value copies.
- MVKPipeline remove test for depth bounds support since
it's checked before GPU encoding.
- MVKDepthBias member order same as in Vulkan calls.
- Whats_New.md consolidate notes about MVK_USE_METAL_PRIVATE_API.
This isn't even a regular SPI. It's not even present in the Metal
framework. It's exposed by the driver. Only AMD drivers support the
method we need for now.
Metal actually supports this, but this is a hidden property of the
`MTLSamplerDescriptor`. It's not part of the public API. Guard our use
of it appropriately.
This support was always there in Metal. It was just hidden from public
view--but not from prying eyes on the Objective-C metadata.
I had initially thought they were using OpenGL/Vulkan values for the
logic operation. When that didn't work, I then tried D3D11 values. I
guess D3D11 makes sense, because the Intel GPU drivers were the first to
support this in Metal.
Move the definition of `MVK_USE_METAL_PRIVATE_API` into
`"MVKCommonEnvironment.h"` so we can use it from non-C++ code.
With the new `MVK_CONFIG_USE_METAL_PRIVATE_API`, the user can prevent their
use at run time without recompiling MoltenVK. This may be useful for
troubleshooting purposes.
The extra member is because the compiler adds tail padding to make the
struct aligned on an 8-byte boundary, so the `static_assert()` fails
without it.
There are many MVKCommand subclasses that simply encode a single value,
resulting in loads of repetitive copy-pasted code.
- Add abstract template superclass MVKSingleValueCommand
for these concrete command classes.
- Modify MVKCmdSetBlendConstants to hold an MVKColor32 so it can
subclass from MVKSingleValueCommand, and modify MVKGraphicsPipeline
and MVKRenderingCommandEncoderState to use MVKColor32.
- Remove trivial comments for simple concrete Vulkan command classes.
- Add MVK_USE_METAL_PRIVATE_API build setting to allow MoltenVK
to be built with access to Metal private API calls.
- Add support for VkPhysicalDeviceFeatures::wideLines feature
when MVK_USE_METAL_PRIVATE_API is enabled in a MoltenVK build.
- Set lineWidthRange and lineWidthGranularity to reasonable arbitrary values.
Implementation did not correctly handle array textures when resolving
unresolvable textures like r8uint formats. Add kernel modules to
correctly resolve through the compute pass.
Fixes CTS failures in test families:
dEQP-VK.api.image_clearing.core.clear_color_attachment.*
dEQP-VK.renderpass.suballocation.multisample_resolve.*
- Xcode now supports building dylib for iOS Simulator
(but unfortunately not yet tvOS Simulator).
- Restore support for iOS Simulator destination in recent update to
Cube demo that uses dynamic-linking, by using script build phase
to overwrite the iOS build of MoltenVK with the iOS Simulator build.
Fix crash on CTS test:
dEQP-VK.robustness.robustness1_vertex_access.out_of_bounds_stride_30_middle_of_buffer
Bindings with multiple vertex attributes would not correctly detect
if the whole binding was remapped to new location/s. This meant
original binding's stride was never set to 0 which would report an
error and in some cases crash.
Fix issue where push constants contain a buffer address, but no descriptor
resources are encoded, resulting in addressed buffer not resident in GPU.
- Add MVKGPUAddressableBuffersCommandEncoderState to track when the
GPU-addressable buffer usage needs to be encoded, and only encode
them once per Metal renderpass.
- Set MVKGPUAddressableBuffersCommandEncoderState dirty whenever
a buffer is bound for a descriptor or a push constant.
Unrelated changes:
- MVKCommandEncoder::finalizeDrawState() reorder encoding of encoder
states to encode resource and push-constant encoder states together.
- Move getGraphicsPipeline() and getComputePipeline() to MVKCommandEncoder.
- MVKDevice Remove preallocation on _resources and _gpuAddressableBuffers.
- Align conditions for VkPhysicalDeviceVulkan12Features::bufferDeviceAddress
to those for VK_KHR_buffer_device_address/VK_EXT_buffer_device_address.
- MVKImage add functions to consolidate mapping plane indexes to memory bindings
to add safety in situation where one memory binding supports all planes.
- Update MoltenVK version to 1.2.8 (unrelated).
- Statically expose vkGetInstanceProcAddr(), even
when MVK_HIDE_VULKAN_SYMBOLS is enabled.
- To support Volk, link Cube demo dynamically to libMoltenVK.dylib
instead of statically to MoltenVK.xcframework.
- Add Volk repo to fetchDependencies script and
ExternalRevisions/Volk_repo_revision file.
- Cube.xcodeproj modify header paths, use of Volk,
and remove old and unused files.
- Update Demos/README.md to explain that Volk requires MoltenVK
be built with build setting MVK_HIDE_VULKAN_SYMBOLS enabled.
- MVKInstance support aliasing function name in one extension to a
function in another extension, to allow MVK_HIDE_VULKAN_SYMBOLS to
work with extensions promoted to another extension, but not to core,
and remove additional duplicate functions that were promoted to 1.3,
but were breaking use of MVK_HIDE_VULKAN_SYMBOLS.
To consistently modify settings based on MTLDevice,
MTLPixelFormats constructor retrieves or creates
temp MTLDevice once, and passes to support functions.
- Add MVKInflectionMap collection to manage lookups based on enums
that have a large set of consecutive elements, plus additional enum
values that are more sparsely assigned.
- Recognize every MTLPixelFormat value can be held in uint16_t.
- Reduce inflection-map sizes by calling shrink_to_fit().
- runcts script log completion time (unrelated).
- Add MVKInflectionMap collection to manage lookups based on enums
that have a large set of consecutive elements, plus additional enum
values that are more sparsely assigned.
- Recognize every MTLPixelFormat value can be held in uint16_t.
- Reduce inflection-map sizes by calling shrink_to_fit().
- runcts script log completion time (unrelated).
- Add MVKInflectionMap collection to manage lookups based on enums
that have a large set of consecutive elements, plus additional enum
values that are more sparsely assigned.
- Recognize every MTLPixelFormat value can be held in uint16_t.
- Reduce inflection-map sizes by calling shrink_to_fit().
- runcts script log completion time (unrelated).
- Remove MVKPixelFormats::_mtlFormatDescIndicesByMTLVertexFormats and
index into _mtlVertexFormatDescriptions using MTLVertexFormat directly.
- Fix assertion to test MTLVertexFormat < _mtlVertexFormatCount.
- Document the name of the MoltenVK driver layer.
- Support future multiple string members in MVKConfiguration.
- Add static assert on number of string members in MVKConfigruation.
- Rename global mvkConfig() to getGlobalMVKConfig().
- Rename global mvkSetConfig() to mvkSetGlobalConfig().
- Remove unused mvkPrintSizeOf() macro. (unrelated).
- Trim trailing spaces from Markdown documents because
it causes double-spaces in some Markdown readers (unrelated).
- MVKGraphicsPipeline::isRenderingPoints() fix regression error
to support dynamically setting point topology.
- Move emulation of VK_POLYGON_MODE_POINT in Metal, if the polygon model is static,
to MVKRenderingCommandEncoderState, to handle dynamic setting of topology.
- MVKDevice populate VkPhysicalDeviceExtendedDynamicState3PropertiesEXT.
- Move error reporting in mvkMTLTriangleFillModeFromVkPolygonModeInObj() to encoding.
- MVKRenderingCommandEncoderState::setCullMode() use getContent()
for readability and consistency (unrelated).
- Pass pipeline object to datatype functions for reporting accuracy (unrelated).