3098 Commits

Author SHA1 Message Date
Bill Hollings
bb3913bd84
Merge pull request #2114 from billhollings/update-copyright-dates
Update copyright notices to year 2024.
2024-01-04 17:17:13 -05:00
Bill Hollings
d9f75ed812 Update copyright notices to year 2024. 2024-01-04 14:51:53 -05:00
Bill Hollings
48adb42d37
Merge pull request #2105 from billhollings/fix-mtl-fmt-lookup
Fix Metal vertex format lookup logic and reduce memory used by MVKPixelFormats lookups.
2024-01-04 14:25:11 -05:00
Bill Hollings
a836e18050 Reduce memory used by MVKPixelFormats lookups.
- 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).
2024-01-04 12:02:28 -05:00
Bill Hollings
0654928a96 Reduce memory used by MVKPixelFormats lookups.
- 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).
2024-01-03 12:23:38 -05:00
Bill Hollings
d20d13fe27
Merge pull request #2108 from spnda/format_feature_flags2
Add: KHR_format_feature_flags2
2024-01-03 10:58:16 -05:00
Bill Hollings
ae073e737e
Merge pull request #2110 from spnda/KHR_calibrated_timestamp
Add: KHR_calibrated_timestamp
2024-01-03 10:55:41 -05:00
sean
28d512cb51 Upgrade all internal format feature usage to 2 2024-01-03 08:03:33 +01:00
sean
e49a69e617 Add: KHR_format_feature_flags2 2024-01-03 08:03:27 +01:00
sean
6e94ff0bcc Add: KHR_calibrated_timestamp 2024-01-03 07:58:13 +01:00
Bill Hollings
3cabd30719
Merge pull request #2109 from spnda/KHR_vertex_attribute_divisor
Add: KHR_vertex_attribute_divisor
2024-01-02 12:06:11 -05:00
sean
3ea2ab7412 Add: KHR_vertex_attribute_divisor 2024-01-01 03:49:04 +01:00
Bill Hollings
88799cf255 Reduce memory used by MVKPixelFormats lookups.
- 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).
2023-12-31 11:51:11 -05:00
Bill Hollings
ad8b963e75
Merge pull request #2107 from spnda/apple9
Add: Recognize Apple9
2023-12-28 15:57:15 -05:00
sean
1cbfd0a0a7 Add: Recognize Apple9 2023-12-28 21:27:26 +01:00
Bill Hollings
22427b8424
Merge pull request #1940 from spnda/metal31_formats
Add support for RG11B10 and RGB9E5 vertex formats
2023-12-27 20:31:27 -05:00
sean
86c080d9c8 Add: Support for RG11B10 and RGB9E5 vertex formats 2023-12-28 01:48:37 +01:00
Bill Hollings
fe65485bfb Fix Metal vertex format lookup logic.
- Remove MVKPixelFormats::_mtlFormatDescIndicesByMTLVertexFormats and
  index into _mtlVertexFormatDescriptions using MTLVertexFormat directly.
- Fix assertion to test MTLVertexFormat < _mtlVertexFormatCount.
2023-12-27 18:38:23 -05:00
Bill Hollings
76233bc654
Merge pull request #2095 from billhollings/VK_EXT_layer_settings
Add support for VK_EXT_layer_settings extension
2023-12-19 18:22:02 -05:00
Bill Hollings
6daa6c0f96
Update MoltenVK/MoltenVK/Utility/MVKEnvironment.cpp
Co-authored-by: Chip Davis <cdavis5x@gmail.com>
2023-12-19 17:20:17 -05:00
Bill Hollings
1ce40f63a4 Fixes from dev review feedback for adding VK_EXT_layer_settings extension.
- 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).
2023-12-19 11:17:39 -05:00
Bill Hollings
9fbf8a1fca
Merge pull request #2099 from karelrooted/fix-tvos-memory-size
Fix system memory size of tvOS
2023-12-19 09:59:25 -05:00
Bill Hollings
971096d70d
Merge pull request #2100 from billhollings/fix-dyn-point-topology
Fix regression error and properties in point-topology/polygon-mode behavior.
2023-12-19 09:56:00 -05:00
karelrooted
d483d620b6 Fix system memory size of tvOS
use sysctlbyname("hw.memsize") to get sytem memory size instead of host_info,
host_info is not available on tvOS, so we change to sysctlbyname which support all apple platforms

apple document didn't stat this API is available on tvOS though,
https://developer.apple.com/documentation/kernel/1387446-sysctlbyname
2023-12-19 14:00:45 +08:00
Bill Hollings
c4b7232f36 Fix regression error and properties in point-topology/polygon-mode behavior.
- 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).
2023-12-18 13:42:02 -05:00
Chip Davis
793c7cf34d
Merge pull request #2098 from SRSaunders/heapquery-fix
Fix heapUsage query for non-unified memory devices
2023-12-16 14:19:19 -08:00
Chip Davis
99123bf1dc
Use auto instead of an explicit type. 2023-12-16 14:55:04 -07:00
Stephen Saunders
28be920b2f Check for Rev3 task info / ledger_tag_graphics_footprint availability at runtime 2023-12-15 22:15:53 -05:00
Stephen Saunders
ef0ac40cff Add a defensive guard to ensure heapUsage[0] calculation is always sane 2023-12-15 21:04:12 -05:00
Stephen Saunders
ea3cbbc596 Fix VkPhysicalDeviceMemoryBudgetPropertiesEXT heapUsage query for non-unified memory devices 2023-12-15 18:09:39 -05:00
Bill Hollings
0fc9657bbd Update documentation for the VK_EXT_layer_settings extension.
- Add MoltenVK_Configuration_Parameters.md to
  document the MoltenVK configuration parameters.
- Deprecate vkSetMoltenVKConfigurationMVK().
- Deprecate mvk_config.h and move content to mvk_private_api.h and mvk_deprecated_api.h.
- Streamline lock on retrieval of MVKLayerManager singleton (unrelated).
2023-12-14 16:44:40 -05:00
Bill Hollings
2cccfd516e
Merge pull request #2088 from etang-cw/PixelFormatView
Don't enable PixelFormatView just in case we need it to copy
2023-12-12 12:55:38 -05:00
Evan Tang
d0e00ad3be Don't enable PixelFormatView just in case we need it to copy
Not worth the performance hit to everything else
2023-12-11 22:05:38 -06:00
Bill Hollings
ac46188bba Merge main branch into VK_EXT_layer_settings branch. 2023-12-09 13:31:53 -05:00
Bill Hollings
e6a3886313
Merge pull request #2086 from billhollings/VK_EXT_headless_surface
Add support for extension VK_EXT_headless_surface.
2023-12-05 09:11:50 -05:00
Bill Hollings
90eb1af19f Add support for extension VK_EXT_headless_surface.
- Consolidate info about CAMetalLayer and headless in MVKSurface.
- MVKSwapchainImage remove getCAMetalDrawable()
  and focus on abstracting getMTLTexture().
- MVKPresentableSwapchainImage::getCAMetalDrawable() return nil if headless.
- Add MVKPresentableSwapchainImage::_mtlTextureHeadless to support
  a fixed MTLTexture that is not retrieved from a CAMetalDrawable.
- MVKPresentableSwapchainImage refactor signalling semaphores and fences.
- MVKPresentableSwapchainImage don't lock when signalling semaphores and fences.
- If no present occurs, actualPresentTime will be zero. Set it to current
  time, instead of to desiredPresentTime, since it's more accurate.
- Rework timestamps:
  - Remove _mvkTimestampBase so mvkGetTimestamp() is equal to
    mach_absolute_time(), which is used in presentation timing.
  - Add mvkGetRuntimeNanoseconds().
  - Rename mvkGetAbsoluteTime() to mvkGetContinuousNanoseconds().
  - Remove mvkGetTimestampPeriod() as unused.
- MVKSemaphoreMTLEvent::encodeDeferredSignal remove redundant nil test (unrelated).
- Fix swapchain and surface bugs when windowing system
  is accessed from off the main thread (unrelated).
- Log warning when deprecated functions vkCreateMacOSSurfaceMVK()
  or vkCreateIOSSurfaceMVK() are used (unrelated).
- Remove documentation for visionos, as support is not ready (unrelated).
2023-12-04 11:56:22 -05:00
Bill Hollings
8820c53666
Merge pull request #2081 from cdavis5e/agx-cube-grad-fixup
MVKPipeline: Enable the cube texture gradient workaround for Apple Silicon
2023-11-29 09:59:06 -05:00
Chip Davis
d0dba760e7 MVKPipeline: Enable the cube texture gradient workaround for Apple Silicon.
Update SPIRV-Cross to pull in the code for the workaround.

Fixes 8 tests under `dEQP-VK.glsl.texture_functions.texturegrad.*`.
2023-11-28 14:08:49 -08:00
Bill Hollings
5bd65fc8e8
Merge pull request #2074 from cdavis5e/b4g4r4a4-unorm
MVKPixelFormats: Handle the `B4G4R4A4` format.
2023-11-23 09:45:49 -05:00
Bill Hollings
645aaa4ecb
Merge pull request #2073 from cdavis5e/min-max-descriptor-count
MVKDevice: Clamp max per-set descriptor limit to minimum 1024.
2023-11-23 09:21:37 -05:00
Bill Hollings
88c9176a5e
Merge pull request #2076 from cdavis5e/required-limits
MVKDevice: Correct some required limits.
2023-11-23 09:11:02 -05:00
Bill Hollings
596686160f
Merge pull request #2077 from billhollings/fix-initial-timestampPeriod
Fix initial value of VkPhysicalDeviceLimits::timestampPeriod on non-Apple Silicon GPUs.
2023-11-23 08:49:38 -05:00
Chip Davis
44b361390a MVKDevice: Clamp max per-set descriptor limit to minimum 1024.
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`.
2023-11-22 19:05:50 -08:00
Bill Hollings
a7372edafe Fix initial value of VkPhysicalDeviceLimits::timestampPeriod on non-Apple Silicon GPUs.
- 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.
2023-11-22 17:24:09 -05:00
Bill Hollings
e12d776aa8
Merge pull request #2075 from cdavis5e/empty-external-types
MVKBuffer, MVKImage: Also ignore no external handle types specified.
2023-11-22 09:43:23 -05:00
Bill Hollings
77d5091940
Merge pull request #2072 from cdavis5e/mandatory-descriptor-indexing
Enable some mandatory `VK_EXT_descriptor_indexing` features.
2023-11-22 08:46:05 -05:00
Bill Hollings
7e2b45fcf2
Merge pull request #2071 from cdavis5e/debug-utils-device
MVKDevice: Expose `VK_EXT_debug_utils` device functions as device functions.
2023-11-22 08:43:48 -05:00
Chip Davis
552e5c03ba MVKPixelFormats: Handle the B4G4R4A4 format.
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*`
2023-11-22 02:37:16 -08:00
Chip Davis
ff21180909 Enable some mandatory VK_EXT_descriptor_indexing features.
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`.
2023-11-22 01:08:37 -08:00
Chip Davis
e09ca0186f MVKDevice: Expose VK_EXT_debug_utils device functions as device functions.
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`
2023-11-22 01:07:03 -08:00