2773 Commits

Author SHA1 Message Date
TellowKrinkle
a233e0b5ac Add single-queue handling of VkSemaphore 2022-08-21 23:45:59 -05:00
TellowKrinkle
21a4947e98 Remove MTLFence semaphores
They did nothing.  Might as well call them YOLO semaphores.
2022-08-20 20:41:40 -05:00
Bill Hollings
ea5a53d13c
Merge pull request #1691 from billhollings/VK_KHR_shader_float_controls
Add support for the VK_KHR_shader_float_controls.
2022-08-18 18:55:29 -04:00
Bill Hollings
11679be153
Merge pull request #1690 from bangnoise/pr/localizedName-crash-macOS_10_14
Fix crash in vkCreateSwapchainKHR() on macOS 10.14 and earlier
2022-08-18 17:54:36 -04:00
Tom Butterworth
47d2c74bd1
Style fix
Co-authored-by: Bill Hollings <bill.hollings@brenwill.com>
2022-08-18 21:55:17 +01:00
Bill Hollings
e0a50c8f2d Add support for the VK_KHR_shader_float_controls extension.
- 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.
2022-08-18 13:35:35 -04:00
Tom Butterworth
07ac3c8603 Fix crash in vkCreateSwapchainKHR() on macOS 10.14 and earlier 2022-08-18 16:54:20 +01:00
Bill Hollings
d447ea7940
Merge pull request #1686 from billhollings/fix-1.2-promotion-typo
Remove KHR suffix typo from vkGetDeviceMemoryOpaqueCaptureAddress promotion to Vulkan 1.2.
2022-08-17 13:01:30 -04:00
Bill Hollings
3ceb786440 Remove KHR suffix typo from vkGetDeviceMemoryOpaqueCaptureAddress promotion to Vulkan 1.2. 2022-08-17 12:42:20 -04:00
Bill Hollings
93a171a6e1
Merge pull request #1683 from billhollings/fix-swapchain-retention
Fix retention of MVKSwapchain for future drawable presentations.
2022-08-16 16:53:49 -04:00
Bill Hollings
666d7ed951
Merge pull request #1682 from spnda/vulkan_1_2_commands
Add Vulkan 1.2 core commands
2022-08-16 16:52:19 -04:00
sean
89b3b5f922
Add aliases for draw_indirect_count 2022-08-16 22:06:19 +02:00
Bill Hollings
33ca59ef13 Fix retention of MVKSwapchain for future drawable presentations.
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.
2022-08-16 15:27:20 -04:00
sean
546b98e62e
Add Vulkan 1.2 core commands 2022-08-16 21:08:46 +02:00
Bill Hollings
ebcefa2d33
Merge pull request #1681 from scandit-opm/feature/make-cereal-optional
Add MVK_USE_CEREAL build option to avoid use of Cereal library.
2022-08-16 12:13:29 -04:00
Marcel Opprecht
694f2e5e88 Implement review comments 2022-08-16 10:24:56 +02:00
Marcel Opprecht
20b0cf8498 Add MVK_EXCLUDE_CEREAL build option to avoid use of Cereal library. 2022-08-15 08:24:03 +02:00
Bill Hollings
b051111953
Merge pull request #1680 from billhollings/sdk-1.3.224
Update dependency libraries to match Vulkan SDK 1.3.224.
2022-08-12 17:54:32 -04:00
Bill Hollings
f487a14975 Update dependency libraries to match Vulkan SDK 1.3.224.
Update What's New document.
2022-08-12 16:54:24 -04:00
Bill Hollings
a87e223543
Merge pull request #1677 from billhollings/fix-missing-metal-buffer-binding
Fix occasional missing Metal buffer binding when only offset changes.
2022-08-12 13:09:06 -04:00
Bill Hollings
70c6b09ca2 Defer marking overridden descriptor buffer bindings to encoding time.
- MVKPushConstantsCommandEncoderState move marking descriptor buffer
  binding override from markDirty() to encodeImpl().
- MVKCommandEncoder::setXXXBytes() calls optionally mark overridden descriptor
  buffer bindings as dirty, allowing this functionality to be generalized.
- MVKMTLBufferBinding::update() inline buffers never update just offset
  because inline contents may have changed.
- MVKCmdClearAttachments mark specific overridden buffer bindings dirty
  instead of marking entire MVKGraphicsResourcesCommandEncoderState dirty.
- MVKResourcesCommandEncoderState::bind() don't mark entire
  MVKResourcesCommandEncoderState dirty unless the binding
  itself was marked dirty (unrelated optimization).
- Rename markPushConstantBinding() to markBufferIndexDirty().
2022-08-12 10:29:56 -04:00
Bill Hollings
5e324d620c Fix occasional missing Metal buffer binding when only offset changes.
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).
2022-08-10 20:21:25 -04:00
Bill Hollings
f3ad8e2e5a
Merge pull request #1676 from billhollings/reset-desc-pool-perf
Improve performance of vkResetDescriptorPool().
2022-08-09 17:18:41 -04:00
Bill Hollings
b16fef0ca2 Improve performance of vkResetDescriptorPool().
- 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).
2022-08-09 16:28:22 -04:00
Bill Hollings
af88bb952b
Merge pull request #1675 from billhollings/support-vk12-device-feat-prop-structs
Support Vulkan 1.2 device feature and property structs.
2022-08-06 11:11:43 -04:00
Bill Hollings
c747d469ca Support Vulkan 1.2 device feature and property structs.
In preparation for Vulkan 1.2, support the following device feature
and property structures, and use them to populate the corresponding
device feature and property values originally supplied by Vulkan
extensions, to ensure a single source of truth for these values:

- VkPhysicalDeviceVulkan11Features
- VkPhysicalDeviceVulkan11Properties
- VkPhysicalDeviceVulkan12Features
- VkPhysicalDeviceVulkan12Properties

Disable VkPhysicalDeviceVulkan12Features::drawIndirectCount and
VkPhysicalDeviceVulkan12Features::samplerFilterMinmax, to indicate that
Vulkan 1.2 support will not include extensions VK_KHR_draw_indirect_count
and VK_EXT_sampler_filter_minmax, respectively.

Support enabling device features during VkDevice creation using
VkPhysicalDeviceVulkan11Features and VkPhysicalDeviceVulkan12Features.
2022-08-05 19:56:44 -04:00
Bill Hollings
d1490e8fb0
Merge pull request #1674 from billhollings/device-feature-tracking-enhancements
MVKDevice consolidate enabling device feature tracking.
2022-08-05 16:11:37 -04:00
Bill Hollings
88f1466d8b MVKDevice consolidate enabling device feature tracking.
- Add MVKDeviceFeatureStructs.def file to describe each device feature
  struct, and define, populate, and manage MVKDevice device feature
  tracking iVars using the list in this file.
- Reorder switch cases in MVKPhysicalDevice::getFeatures() to match the
  list in MVKDeviceFeatureStructs.def.
- Where possible, remove extension suffixes from device feature structs
  and associated VkStructureType values.
- Remove const qualifier from device feature enabling structs.
2022-08-05 15:21:23 -04:00
Bill Hollings
11120056ff
Merge pull request #1671 from billhollings/fix-debug-utils-message-types
Report appropriate values of VkDebugUtilsMessageTypeFlagsEXT
2022-07-30 18:14:35 -04:00
Bill Hollings
cfe259fce2 Report appropriate values of VkDebugUtilsMessageTypeFlagsEXT
for debug util messages generated within MoltenVK.
2022-07-30 17:38:20 -04:00
Bill Hollings
b4ae2bc1d8
Merge pull request #1669 from billhollings/fix-retrieve-screen-refresh-duration
Fix retrieval of accurate refresh duration across multiple display screens.
2022-07-30 15:39:52 -04:00
Bill Hollings
152c605c20 Fix retrieval of accurate refresh duration across multiple display screens.
- 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.
2022-07-29 18:15:46 -04:00
Bill Hollings
c341f168e4
Merge pull request #1667 from MennoVink/patch-2
Update MVKGPUCapture.mm
2022-07-29 11:51:59 -04:00
Bill Hollings
50cd39bf74
Merge pull request #1666 from MennoVink/patch-1
Update copy_lib_to_staging.sh
2022-07-29 11:47:42 -04:00
Bill Hollings
f11347cea0
Merge pull request #1668 from billhollings/demo-screen-resolution-optimzing
Update macOS Cube demo to demonstrate optimizing swapchain across multiple screens.
2022-07-28 18:03:34 -04:00
Bill Hollings
991e1a9876 Update macOS Cube demo to demonstrate optimizing swapchain across multiple screens.
- 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.
2022-07-28 16:33:10 -04:00
MennoVink
53a14dee68
Update MVKGPUCapture.mm
Fix #1598 for macOS 12.4
2022-07-28 20:44:05 +02:00
MennoVink
46b74c8a40
Update copy_lib_to_staging.sh
Allow for building on removable volumes with a space in their name, ie "/Volumes/T7 Touch/"
2022-07-28 20:33:27 +02:00
Bill Hollings
60b2ae51dd
Merge pull request #1663 from billhollings/fix-inline-block-update-desc-with-template
Fix vkUpdateDescriptorSetWithTemplate() for inline block descriptors.
2022-07-27 14:23:51 -04:00
Bill Hollings
40d341ded2 Rename entities for VK_KHR_descriptor_update_template extension.
Rename entities for VK_KHR_descriptor_update_template
extension since it's promoted to Vulkan 1.1.
2022-07-26 17:40:51 -04:00
Bill Hollings
85c4b5c680 Fix vkUpdateDescriptorSetWithTemplate() for inline block descriptors.
Wrap incoming data in VkWriteDescriptorSetInlineUniformBlock
before passing to MVKInlineUniformBlockDescriptor::write().
2022-07-26 16:57:47 -04:00
Bill Hollings
b88c94a651
Merge pull request #1660 from billhollings/gpucapturescope-macos125
Apply Apple fix to MTLCaptureScope retention bug to macOS 12.5.
2022-07-25 13:35:15 -04:00
Bill Hollings
4c18bf49df Apply Apple fix to MTLCaptureScope retention bug to macOS 12.5 and iOS 15.4. 2022-07-25 11:31:44 -04:00
Bill Hollings
33d0420f0c
Merge pull request #1659 from billhollings/ignore-immutable-sampler-update
Ignore sampler update in descriptor set bindings that use immutable samplers.
2022-07-25 00:28:48 -04:00
Bill Hollings
3008ec71e8 Ignore sampler update in descriptor set bindings that use immutable samplers.
Inline MVKDescriptorSetLayoutBinding::getImmutableSampler()
for consistency with usesImmutableSamplers().
2022-07-24 20:36:02 -04:00
Bill Hollings
ed1f1f4866
Merge pull request #1658 from billhollings/fix-query-pool-wait-block
Fix query pool wait block when query is not encoded to be written to.
2022-07-24 16:54:29 -04:00
Bill Hollings
cb57bf9973 Fix query pool wait block when query is not encoded to be written to.
When checking query wait completion, all queries were previously
checked for Available status, and blocked until all became Available.
However, only queries that were encoded to be written should be checked.
It is okay for queries that are not encoded to be written to remain in
Initial state, and not block the wait.
2022-07-24 15:33:02 -04:00
Bill Hollings
a044496a65
Merge pull request #1653 from billhollings/gpuaddress-tier2
Check MTLDevice for gpuAddress support.
2022-07-19 14:52:01 -04:00
Bill Hollings
b04a6db72e Check MTLDevice for gpuAddress support.
Support by the MTLDevice for Metal Tier 2 argument buffers has an
impact on both descriptor indexing and buffer device address support.
Add MVKPhysicalDeviceMetalFeatures::argumentBuffersTier, to track
the MTLDevice argument buffers support tier, set it from
[MTLDevice argumentBuffersSupport], and subsequently enable support for
VK_KHR_buffer_device_address and VK_EXT_buffer_device_address extensions,
and set descriptor indexing resource counts, based on it.
Update documentation requirements.
2022-07-19 14:30:38 -04:00
Bill Hollings
fe8d4d4d34
Merge pull request #1636 from spnda/fix_swapchain_color_space
Fix: No need to check if EXT_swapchain_color_space was enabled
2022-07-15 15:24:08 -04:00