As required by the Vulkan spec.
Fixes the CTS tests
`dEQP-VK.api.info.vulkan1p2_limits_validation.khr_maintenance_3` and
`dEQP-VK.api.maintenance3_check.maintenance3_properties`.
- Don't update value of timestampPeriod on first measurement.
- Force that first measurement upon creation of MVKPhysicalDevice, so an
accurate value for timestampPeriod will be calculated when next queried.
Handle it similarly to the `A4R4B4G4` and `A4B4G4R4` formats, with a
swizzle. Vulkan requires support for this format.
Fixes the following tests:
* `dEQP-VK.api.info.format_properties.b4g4r4a4_unorm_pack16`.
* `dEQP-VK.texture.explicit_lod.2d.formats.b4g4r4a4*`
These features must be supported if the extension or `descriptorIndexing`
features is.
Conversely, disable the extension and the feature if we cannot support
the features.
Fixes `dEQP-VK.info.device_mandatory_features`.
Despite being an instance extension, `VK_EXT_debug_utils` provides some
functions that belong to the device, not the instance. Therefore, when
checking device functions, we must also check if an enabled *instance*
extension provides the function.
Also, only enable two-extension functions if *both* extensions or the
requisite core version are enabled. In all cases, these functions require
both extensions or the first extension plus some core version.
Fixes two CTS tests:
`dEQP-VK.info.instance_extension_device_functions`
`dEQP-VK.api.version_check.entry_points`
If the `fullDrawIndexUint32` feature is supported, then
`maxDrawIndexedIndexValue` must be `UINT32_MAX`. I had originally done
this when I turned the feature on, but for a while now, we've been
setting it to one less, because primitive restart can't be disabled and
the value is defined to exclude primitive restart.
The wording in the spec is ambiguous. The description of
`maxDrawIndexedIndexValue` says:
> * `maxDrawIndexedIndexValue` is the maximum index value that **can**
> be used for indexed draw calls when using 32-bit indices. *This
> excludes the primitive restart index value of 0xFFFFFFFF.* [emphasis
> added]
But the description of `fullDrawIndexUint32` says:
> * `fullDrawIndexUint32` specifies the full 32-bit range of indices is
> supported for indexed draw calls when using a VkIndexType of
> `VK_INDEX_TYPE_UINT32`. `maxDrawIndexedIndexValue` is the maximum
> index value that **may** [sic] be used *(aside from the primitive
> restart index, which is always 2<sup>32</sup>-1 when the VkIndexType
> is `VK_INDEX_TYPE_UINT32`)*. If this feature is supported,
> `maxDrawIndexedIndexValue` **must** be 2<sup>32</sup>-1; otherwise
> it **must** be no smaller than 2<sup>24</sup>-1. [emphasis added]
It's unclear whether it means that the primitive restart index is to be
ignored, or the maximum draw index must account for it.
The alternative is to disable `fullDrawIndexUint32` because we cannot
set `maxDrawIndexedIndexValue` to `UINT32_MAX`; but that might mislead
programs into thinking that we only support 24-bit vertex indices.
Fixes the rest of the `dEQP-VK.info.device_properties` test.
Previously, we were erroneously failing create calls that specified zero
external handle types (as opposed to omitting external memory info
entirely).
Fixes 6 tests under
`dEQP-VK.api.buffer_memory_requirements.create_no_flags.ext_mem_flags_included.*`
- Move patch point tracking from pipeline state to render state, and
remove MVKPipelineCommandEncoderState subclasses no longer needed.
- Move sample location tracking from renderpass input to pipeline
static or dynamic state tracking.
- Restart Metal render pass when sample locations change, and enable
VkPhysicalDeviceSampleLocationsPropertiesEXT::variableSampleLocations.
- Fix regression that broke VK_POLYGON_MODE_LINE (unrelated).
- Fix regression in marking MVKRenderingCommandEncoderState
dirty after vkCmdClearAttachments() (unrelated).
- Don't create global MVKPixelFormats instance during launch,
as this triggers a call to MTLCopyAllDevices(), which can
deadlock if app is also launching other services that use Metal.
- Update to latest SPIRV-Cross contining the fix.
- Modify CTS options in runcts script to avoid outputting full CTS log,
and use less file caching, all to reduce memory and filespace consumption,
and possibly improve performance (unrelated).
- Update MoltenVKShaderConverter tool to include Metal 3.1 support
and improved argument buffer settings (unrelated).
- Force Github CI to use Python 3.11, to avoid crash in
glslang::update_glslang_sources.py due to use of distutils,
removed in Python 3.12 (unrelated).
- Small unrelated non-functional edits.
- Add --keep-cache option to control whether or not to retain the
External/build/Intermediates directory (default not retained).
- Export KEEP_CACHE & SKIP_PACKAGING to be available within scripts
used by ExternalDependencies Xcode builds.
- Move BLD_SPECIFIED to build() instead of build_impl() to avoid
updating it from background thread (which will fail).
- Update MoltenVK version to 1.2.7 (unrelated).
- Add CompilerMSL::Options::replace_recursive_inputs to pipeline cache (unrelated).
- Update GitHub CI to Xcode 15.0.
- Update Whats_new.md document.
- Move check and warning to MVKRenderingCommandEncoderState.
- Pass primitiveRestartEnable to MVKRenderingCommandEncoderState.
- Warn only if primitiveRestartEnable disabled and strip topology is used.
- On Apple GPUs, set timestampPeriod to 1.0.
- On non-Apple GPUs, calculate timestampPeriod each time it is retrieved.
- On older devices that do not support GPU timestamps, use nanosecond
CPU timestamps to be consistent with timestampPeriod of 1.0.
- Change MVKConfiguration::timestampPeriodLowPassAlpha and environment
variable MVK_CONFIG_TIMESTAMP_PERIOD_LOWPASS_ALPHA to 1.0, to use
only latest value by default.
- Add build-time verification that MVKConfigMembers.def
includes all members of MVKConfiguration (unrelated).
- MVKPipeline only work around zero stride if stride is static.
- Ensure dynamic vertex stride is not enabled on builds before Xcode 15.
- Add MVKRenderStateType::LineWidth for track all default options (unrelated).
- Fix runtime failure on Metal versions that don't support dynamic attribute stride.
- Add MVKCommandEncoder::encodeVertexAttributeBuffer() consolidation function.
- Remove unnecessary validations that will be caught by Vulkan validation layers.
- To reduce memory, remove command class and pools for rendering commands that
are not supported, and perform no validation.
- Document extension conformance limitations in MoltenVK_Runtime_UserGuide.md.
- Add MVKPipelineCommandEncoderState subclasses
MVKGraphicsPipelineCommandEncoderState & MVKComputePipelineCommandEncoderState,
track patch control points in MVKGraphicsPipelineCommandEncoderState,
and add getGraphicsPipeline() & getComputePipeline() to simplify casting.
- Rename MVKRasterizingCommandEncoderState to MVKRenderingCommandEncoderState,
and MVKCommandEncoder::_rasterizingState to _renderingState.
- Rename MVKCmdRenderPass.h/mm to MVKCmdRendering.h/mm.
- Move MVKCmdExecuteCommands from MVKCmdRenderPass.h/mm to MVKCmdPipeline.h/mm.
- While working on vkCmdSetLogicOpEXT(), add support for
vkCmdSetLogicOpEnableEXT() from VK_EXT_extended_dynamic_state3.
- Add MVKRasterizingCommandEncoderState to consolidate handling
of static and dynamic rasterizing states in a consistent manner.
- Rework MVKDepthStencilCommandEncoderState to consolidate handling
of static and dynamic depth states in a consistent manner.
- MVKMTLDepthStencilDescriptorData clean up content setting, and struct layout.
- Add MVKRenderStateType to enumerate render state types.
- Add MVKRenderStateFlags to track binary info about states (enabled, dirty, etc).
- Add MVKMTLBufferBinding::stride.
- Add MVKPhysicalDeviceMetalFeatures::dynamicVertexStride.
- Set MVKPhysicalDeviceMetalFeatures::vertexStrideAlignment
to 1 for Apple5+ GPUs (unrelated).
- Set VkPhysicalDeviceLimits::maxVertexInputBindingStride
to unlimited for Apple2+ GPUs (unrelated).
- Add mvkVkRect2DFromMTLScissorRect() and simplify
mvkMTLViewportFromVkViewport() and mvkMTLScissorRectFromVkRect2D().
- MVKFoundation:
- Add mvkEnableAllFlags() and mvkDisableAllFlags().
- Improve performance of mvkClear(), mvkCopy() & mvkAreEqual()
when content is a single simple primitive type (unrelated).
- Declare more functions as static constexpr (unrelated).