2756 Commits

Author SHA1 Message Date
Tom Butterworth
f23ff95a4e Fix crash creating compute pipelines on macOS versions < 10.14 2022-07-10 12:24:43 +01:00
Bill Hollings
ba183b4de7
Merge pull request #1632 from billhollings/support_xcode14
Support Xcode 14, macOS 13, and iOS/tvOS 16
2022-07-08 21:35:52 -04:00
Bill Hollings
8dd1454651 Xcode 14 build fixes from code review and further testing.
- Replace use of deprecated kIOMasterPortDefault with MACH_PORT_NULL.
- Convert an inline VLA with constant length array.
- Add input files to all build phases to trigger dependencies when inputs change.
- Add packaging scripts to per-platform ExternalDependencies targets.
2022-07-08 18:07:18 -04:00
Bill Hollings
5b2e153f26 Fix Xcode projects to support Xcode 11.7.
Add dummy output files to each Xcode Run Script build phase that doesn't
already have dependencies set, to avoid setting alwaysOutOfDate flag
(by disabling "Based on dependency analysis" UI flag), which forces
the Xcode project to a version that can't be read by Xcode 11.7.
2022-07-07 22:28:02 -04:00
Bill Hollings
59554d6139 Update Xcode project build settings to Xcode 14. 2022-07-06 18:23:51 -04:00
Bill Hollings
26d4a13e34 Support Xcode 14, macOS 13, and iOS/tvOS 16.
- Update minimum Xcode deployment targets to macOS 10.13, iOS 11, and tvOS 11,
  to avoid Xcode build warnings.
- Add support for MTLLanguageVersion3_0 enumeration.
- Build efficiencies:
  - Build scripts create_dylib.sh and gen_moltenvk_rev_hdr.sh
    only run if build dependencies require it.
  - Packaging and copy_to_staging.sh scripts are too complex to define dependencies,
    and are fast, so configured to run every time, to avoid build warning.
- Replace use of deprecated sprintf() with  snprintf().
- Replace use of deprecated kIOMasterPortDefault with  kIOMainPortDefault.
- Support old-style GPU debug capture only if building for earlier minimum
  deployment targets, to avoid deprecation warning.
- Update minimum Xcode deployment targets of Cube demo to macOS 10.14, iOS 12,
  and tvOS 12, to avoid Xcode build warning regarding MTLSharedEvent in .
- Update README.md document regarding minimum Xcode deployment targets.
2022-07-06 18:15:10 -04:00
Bill Hollings
0f722b84fb
Merge pull request #1619 from spnda/KHR_buffer_device_address
Add support for KHR_buffer_device_address
2022-07-04 16:21:55 -04:00
sean
83c0ca60fb
Add support for KHR_buffer_device_address 2022-06-16 17:32:25 +02:00
Bill Hollings
49f78f91a4
Merge pull request #1621 from billhollings/vk-ext-metal-objects-squash
Add support for VK_EXT_metal_objects extension.
2022-06-13 22:02:04 -04:00
Bill Hollings
2b05b95974 Add support for VK_EXT_metal_objects extension.
Update Vulkan-Headers version to include new VK_EXT_metal_objects extension.
Update MoltenVK version to 1.1.11.
Update What's New document.
2022-06-11 20:10:06 -04:00
Bill Hollings
a909822b69
Merge pull request #1594 from js6i/perf2
Reducing redundant state changes
2022-06-09 14:58:27 -04:00
Jan Sikorski
07780d6a30 Prevent marking state dirty if not needed.
Reduce the impact of Vulkan's overly static state and avoid reencoding
unchanged state repeatedly. Reduces encoding time.
2022-06-09 14:53:29 +02:00
Jan Sikorski
4db43a5c59 Call MVKCommandEncoderState::beginMetalRenderPass() from the overriden method. 2022-06-09 13:40:08 +02:00
Jan Sikorski
745af5379c Avoid redundant resource bindings.
When new descriptor sets are bound, it may be the case that many of the
bindings are not changed from their previous state. Detect this case and avoid
binding the same resources in the Metal comand buffer repeatedly. If possible,
change only the offset. This saves some encoding time.
2022-06-09 13:40:08 +02:00
Bill Hollings
334e0cee69
Merge pull request #1608 from billhollings/sdk-1.3.216
Update dependency libraries to match Vulkan SDK 1.3.216.
2022-06-06 15:13:27 -04:00
Bill Hollings
292ea5e55a Update dependency libraries to match Vulkan SDK 1.3.216.
Update What's New document.
2022-06-04 21:06:56 -04:00
Bill Hollings
02c29477ab
Merge pull request #1604 from billhollings/update-xcode-build-settings
Update Xcode project build settings.
2022-05-30 19:02:30 -04:00
Bill Hollings
7779f3c098 Update Xcode project build settings.
- Add clang -Wreorder warning.
- Align constructor member inits with member order.
- Update build settings to support Xcode 13.4.
2022-05-30 18:12:14 -04:00
Bill Hollings
d7890c7b98
Merge pull request #1603 from scandit-opm/reorder-ctor
Fix reorder-ctor warnings
2022-05-30 15:44:27 -04:00
Marcel Opprecht
052da8cced Fix reorder-ctor warnings 2022-05-30 17:25:00 +02:00
Bill Hollings
792b8a6a97
Merge pull request #1596 from spnda/google_display_timing_osx
Implement vkGetRefreshCycleDurationGOOGLE() for macOS
2022-05-25 13:50:19 -04:00
Bill Hollings
95cc15c8be
Merge pull request #1600 from spnda/KHR_fragment_shader_barycentric
Add support for VK_KHR_fragment_shader_barycentric extension
2022-05-25 13:49:44 -04:00
sean
9253d5c212
Fix compilation issues 2022-05-25 18:23:30 +02:00
sean
d66238035c
Use maximumFramesPerSecond only as fallback 2022-05-25 18:09:40 +02:00
sean
9b1194afba
Note Metal requirement in UserGuide.md 2022-05-25 15:56:07 +02:00
sean
5e03632d69
Also support the NVIDIA specific extension 2022-05-25 15:17:21 +02:00
sean
a0490cec0f
Use NSScreen maximumFramesPerSecond on macOS 12+ 2022-05-25 14:57:49 +02:00
sean
6cc5110290
Add: Support for KHR_fragment_shader_barycentric 2022-05-24 23:37:04 +02:00
Bill Hollings
2ebb72ea18
Merge pull request #1595 from billhollings/fix-regression-in-dxvk
Fix vertex buffer binding counts when establishing implicit buffers binding indexes.
2022-05-22 18:30:28 -04:00
Bill Hollings
866c0dc8eb Fix vertex buffer binding counts when establishing implicit buffers binding indexes.
This patch fixes a regression caused by 1b6b8bc9 when the implicit buffers
were moved to top of Metal buffer index range.

Fix vertex buffer binding counts when binding indexes are not consecutive,
or when additional synthetic buffer bindings are required to accommodate
vertex attributes that are outside the vertex buffer stride values.
Take into consideration that the app may bind more vertex attribute buffers
than a pipeline may consume, and don't allow these to overwrite any implicit
buffers sent to the shader.

MVKResourcesCommandEncoderState::encodeBinding() clear binding dirty flag
before calling lambda function to allow function operation to possibly
override and leave binding marked dirty.

Set tessellation vertex buffer indexes based on platform maximum vertex stage
buffer count, instead of hardcoding them, to preemptively avoid conflict with
implicit buffers should the platform counts ever change.
2022-05-22 15:50:26 -04:00
spnda
b322ffc7eb
Use superlayer to find NSScreen 2022-05-22 20:49:46 +02:00
kleinerm
08252c1006
Implement vkGetRefreshCycleDurationGOOGLE() for macOS.
So far it always returned a 60 Hz refresh on macOS. Now we query the
actual refresh interval for the NSScreen on which our swapChain is likely
displaying.

Tested on a MacBookPro dual-display setup with builtin 60 Hz Retina panel
and external 100 Hz monitor, showing proper reporting depending on which
monitor the window was displaying on. Tested on macOS 10.15.7 only.
2022-05-22 20:27:53 +02:00
Bill Hollings
27aaaf50c1
Merge pull request #1593 from billhollings/fix-intel-zombie-object
Add workaround for zombie memory bug in Intel Iris Plus Graphics driver when repeatedly retrieving GPU counter sets.
2022-05-12 14:12:56 -04:00
Bill Hollings
695a54037b Add workaround for zombie memory bug in Intel Iris Plus Graphics
driver when repeatedly retrieving GPU counter sets.
2022-05-12 11:40:02 -04:00
Bill Hollings
711231ddf6
Merge pull request #1590 from billhollings/fix-timestamp-fences
Fix error on some Apple GPU's where a vkCmdTimestampQuery() after a renderpass was writing timestamp before renderpass activity was complete.
2022-05-11 15:29:24 -04:00
Bill Hollings
e2168a33db Fix error on some Apple GPU's where a vkCmdTimestampQuery() after a
renderpass was writing timestamp before renderpass activity was complete.

MVKCommandBuffer tracks whether it contains a stage-based timestamp command,
and MVKCommandEncoder updates the timestamp command fence when ending any
Metal command encoder on such a MVKCommandBuffer.

MVKCommandEncoder reorder member variables to avoid layout gaps (unrelated).
MVKCommandBuffer update _commandCount even for single-use immediate command
encoding (unrelated).
2022-05-10 14:51:55 -04:00
Bill Hollings
b8f0828da7
Merge pull request #1587 from billhollings/VK_KHR_separate_depth_stencil_layouts
Add support for VK_KHR_separate_depth_stencil_layouts extension.
2022-05-05 16:09:35 -04:00
Bill Hollings
1bad27cf26 Add support for VK_KHR_separate_depth_stencil_layouts extension.
Add VK_KHR_separate_depth_stencil_layouts and enable its features.
Metal generally ignores image layouts, so nothing further needed.
Update Whats_New.md and MoltenVK_Runtime_UserGuide.md documents
with recently-added extensions.

Passes almost all supported separate_layouts CTS tests, with the
few remaining tests failing due to issues with unrelated capabilities.

Unrelated cleanup:
- MVKDevice enable extensions before features.
- MVKDevice reorder ivar declarations to reduce
  memory layout gaps, and define default values.
- Rename VkSemaphoreStyle to MVKSemaphoreStyle to
  remove potential conflicts with Vulkan Vk name space.
2022-05-05 15:55:26 -04:00
Bill Hollings
790b7aa594
Merge pull request #1584 from billhollings/VK_EXT_separate_stencil_usage
Add support for VK_EXT_separate_stencil_usage extension.
2022-04-30 11:01:57 -04:00
Bill Hollings
cd5b336bec Add support for VK_EXT_separate_stencil_usage extension. 2022-04-29 22:14:05 -04:00
Bill Hollings
718113cd52
Merge pull request #1583 from billhollings/update-spirv-cross
Update to latest SPIRV-Cross.
2022-04-28 10:51:23 -04:00
Bill Hollings
e00fef5b69 Update to latest SPIRV-Cross.
MSL: Emit interface block members of array length 1 as arrays instead of scalars.
2022-04-27 15:02:14 -04:00
Bill Hollings
8c35b085a5
Merge pull request #1578 from smanhaeve/patch-1
Fix vkSetMoltenVKConfigurationMVK function typedef
2022-04-26 11:37:15 -04:00
smanhaeve
409101788a
Fix vkSetMoltenVKConfigurationMVK function typedef
Fixes issue https://github.com/KhronosGroup/MoltenVK/issues/1577
2022-04-25 14:37:00 +02:00
Bill Hollings
1236d2f535
Merge pull request #1575 from billhollings/VK_KHR_dynamic_rendering
Add support for VK_KHR_dynamic_rendering extension
2022-04-21 15:14:58 -04:00
Bill Hollings
abaafd09d7
Update MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm
Co-authored-by: Chip Davis <cdavis@codeweavers.com>
2022-04-21 14:41:22 -04:00
Bill Hollings
a1f3508f8e Optimize reuse of transient renderbuffer and framebuffer for dynamic rendering.
- MVKRenderPass set rendering flags from outside instead of via constructor.
- MVKCommandEncodingContext tracks and manages lifespan of renderpass and
  framebuffer, potentially across multiple MVKCommandEncoders.
- When resuming a suspended dynamic renderpass, reuse the renderpass and
  framebuffer cached in MVKCommandEncodingContext, otherwise create them.
- MVKCommandBuffer::begin() creates local copy of dynamic rendering color formats.
2022-04-19 14:53:15 -04:00
Bill Hollings
751dac4391 Support attachment clearing when some clearing formats are not specified.
Exclude attachment from shader if clearing format is not specified.
2022-04-19 09:02:56 -04:00
Bill Hollings
e3f8ce4ebc Add support for VK_KHR_dynamic_rendering extension.
- MVKDevice track enabling VK_KHR_dynamic_rendering extension features.
- Add MVKCmdBeginRendering and MVKCmdEndRendering command objects
  and associated command pools.
- Add MVKCommandEncoder::beginRendering() which dynamically instantiates
  temporary MVKRenderpass and (imageless) MVKFramebuffer objects to handle
  equivalent renderpass operations.
- MVKCommandEncoder retain and release subpass and framebuffer objects
  to allow transient dynamic instances to be created and destroyed.
- Add support functions to create MVKRenderpass and (imageless)
  MVKFramebuffer objects from VkRenderingInfo.
- MVKRenderpass track VkRenderingFlags.
- MVKRenderSubpass create and track an internal VkPipelineRenderingCreateInfo.
- MVKRenderPassAttachment support LoadOp and StoreOp behavior for
  dynamic rendering suspend and resume.
- Refactor viewMask processing to permit operations on viewMask outside of
  MVKGraphicsPipeline without requiring the presence of an MVKSubpass.
- MVKGraphicsPipeline extract VkPipelineRenderingCreateInfo from MVKRenderSubpass
  if available, or VkGraphicsPipelineCreateInfo::pNext if not.
- MVKCommandBuffer track VkCommandBufferInheritanceRenderingInfo (currently unused).
- (unrelated) vulkan.mm move location of VK_EXT_sample_locations functions
  for layout readability consistency.
2022-04-19 07:27:41 -04:00
Bill Hollings
6b3ef7b51a
Merge pull request #1573 from billhollings/push-constant-binding-fix
Fix error where previously bound push constants can override a descriptor buffer binding
2022-04-18 16:36:31 -04:00