1474 Commits

Author SHA1 Message Date
Bill Hollings
d57c3c845e vkCreateInstance() return error on incompatible Vulkan version only if 1.0. 2020-04-02 19:40:44 -04:00
Bill Hollings
98fadbf68b Fix memory estimates for iOS 13+.
Fix os_proc_available_memory() not being called.
2020-04-02 18:54:22 -04:00
Bill Hollings
a58f6bc441 Update to Vulkan SDK 1.2.135 library dependencies.
Add Scripts/packagePregenSpirvToolsHeaders script to automate packaging Spirv-Tools
headers in support of the fetchDependencies --skip-spirv-tools-build option.
Update Docs/Whats_New.md.
2020-04-02 16:35:48 -04:00
Bill Hollings
df11916217
Merge pull request #850 from billhollings/master
Support screen captures.
2020-04-02 13:41:50 -04:00
Bill Hollings
2037b6c007 Defer resetting MTLTexture in MVKSwapchainImage until request to acquire.
Move call to MVKSwapchainImage::resetMetalDrawable() from immediately after
presentation until request to acquire, to preserve image content for copying
after presentation in cases such as an app screen capture operation.

Testing indicates this deferral has little or no adverse effect on the performance
of retrieving the drawable when next needed.
2020-04-02 12:54:57 -04:00
Bill Hollings
fde9d515ca Remove secondary MVKSwapchainImage constructor. 2020-04-02 11:35:26 -04:00
Bill Hollings
6229582887 Move tracking of swapchain image availability from MVKSwapchain to MVKSwapchainImage. 2020-04-02 10:57:06 -04:00
Bill Hollings
68b5f72d86 Move tracking of CAMetalDrawable from MVKSwapchain to MVKSwapchainImage. 2020-04-01 21:33:29 -04:00
Bill Hollings
327418a6b6 Broaden conditions for host read sync for image memory barriers on macOS.
Ignore pipeline dstStageMask and accept VK_ACCESS_MEMORY_READ_BIT in dstAccessMask.
2020-04-01 16:22:30 -04:00
Bill Hollings
453fbb4045 MVKImage fixes for texture view creation.
Fix potential deadlock when getMTLTexture(MTLPixelFormat) calls getMTLTexture().
Clear texture views when base texture is removed.
2020-03-31 13:25:20 -04:00
Bill Hollings
d5c62cc55a Reorganize code in MVKImage.h/mm to move MVKSwapchainImage closer to MVKImage. 2020-03-30 19:35:01 -04:00
Bill Hollings
d256991a7a
Merge pull request #845 from billhollings/master
Do not create depth/stencil MTLTextures from MTLHeap.
2020-03-30 16:20:20 -04:00
Bill Hollings
b882161519 Do not create depth/stencil MTLTextures from MTLHeap.
See GitHub issues 792 & 832. Depth/stencil textures issued from MTLHeap can be flaky in
some situations, including depth-only rendering on Intel GPUs, and corruption when DS
texture with sampling usage is combined with non-DS texture on a single placement heap.
2020-03-30 15:39:34 -04:00
Bill Hollings
a0e3ab59f4 MVKPhysicalDevice add macros to simplify testing MTLFeatureSet and MTLGPUFamily.
Remove MVKPhysicalDevice::getSupportsGPUFamily();
2020-03-30 14:17:49 -04:00
Bill Hollings
8ec5f93802 MVKInstance instantiate MVKPhysicalDevices in-place instead of using new. 2020-03-30 13:13:54 -04:00
Bill Hollings
fee050372b Move derivation of MTLTextureUsage to MVKPixelFormats.
Add MVKPixelFormats::getMTLTextureUsageFromVkImageUsageFlags(), which takes
into account limitations of pixel formats.
MVKImage remove getMTLTextureUsage(), getSupportsAnyFormatFeature()
and getSupportsAllFormatFeatures().
MVKPixelFormats tracks MVKPhysicalDevice, not just MVKVulkanAPIObject.
MVKPixelFormats refactor constructors and internal retrieval of MTLDevice.
Add MTLPixelFormat to mvkMTLTextureUsageFromVkImageUsageFlags() params for compatibility.
Remove optionality of hasResolveAttachment param in
mvkMTLStoreActionFromVkAttachmentStoreOp() to support C calling.
2020-03-30 12:45:18 -04:00
Bill Hollings
5728f50f0f Add mvkOSVersionIsAtLeast() to simplify and standardizing testing OS version. 2020-03-28 20:11:21 -04:00
Bill Hollings
d04dc46e79
Merge pull request #844 from billhollings/master
Update to latest SPIRV-Cross and Vulkan-Headers and fixes to pipeline cache loading.
2020-03-26 20:42:05 -04:00
Bill Hollings
bd4e78d5a4 Update to latest SPIRV-Cross and Vulkan-Headers and fixes to pipeline cache loading.
Update Cereal archive structs to match latest MoltenVK and SPIRV-Cross structs.
Fix recent error that caused pipeline cache data to be ignored during loading.
Update to Vulkan-Headers version 1.2.135.
Update to latest SPIRV-Cross version.
Update Whats_New.md document.
2020-03-26 18:57:46 -04:00
Bill Hollings
c0c9a66caf
Merge pull request #843 from billhollings/master
Accurately populate Vulkan VkFormatProperties and capabilities.
2020-03-26 16:45:04 -04:00
Bill Hollings
3fa95d4c06 Refactor MVKImageView use without MVKDevice for testing formats.
Replace MVKImageView::getSwizzledMTLPixelFormat() with static validateSwizzledMTLPixelFormat()
to support querying format support without having to create fake MVKImageView instance from
MVKPhysicalDevice::getImageViewIsSupported().
Remove ability for MVKDeviceTrackingMixin and subclasses to work without a MVKDevice.
Remove mvkPlatformPixelFormats().
2020-03-26 14:40:08 -04:00
Bill Hollings
04ae0a61e0 Replace use of memcmp() with mvkAreEqual(). 2020-03-26 11:14:03 -04:00
Bill Hollings
4f1cdef6af Validate format capabilities for MSAA, renderpass attachments, and vkCmdResolveImage().
vkGetPhysicalDeviceImageFormatProperties() tests whether format supports MSAA.
vkCreateRenderPass() validate each attachment supports format capabilities required
by each subpass that uses it.
vkCmdResolveImage() validate that destination attachment supports being resolved to.
MVKPixelFormats add getVkFormatCapabilities(), getMTLPixelFormatCapabilities(),
and vkFormatIsSupportedOrSubstitutable().
Rework type handling in flag functions in MVKFoundation.h.
2020-03-26 00:05:01 -04:00
Bill Hollings
50eba6fee1 Support Xcode 11.4. 2020-03-25 20:24:07 -04:00
Bill Hollings
b09bb763bc Consolidate further static format functions into MVKPixelFormats. 2020-03-25 17:32:29 -04:00
Bill Hollings
622d75f0d2 Rename mvkEnableFlag() to mvkEnableFlags(). 2020-03-25 16:48:53 -04:00
Bill Hollings
b7c742af15 MVKPixelFormats unit tests only run on system default MTLDevice and only run once. 2020-03-23 23:09:34 -04:00
Bill Hollings
a93f2d2f67 Static format functions in mvk_datatypes.mm delegate to MTLPixelFormats.
MVKPixelFormats default constructor use default MTLDevice to initialize.
2020-03-23 22:36:20 -04:00
Bill Hollings
0c03f09df3 Accurately populate Vulkan VkFormatProperties from MTLPixelFormat capabilities,
taking into consideration variations across MTLDevice Features Sets.

Simplify contents and names in MVKMTLFmtCaps enum.
Add MVKVkFormatFeatureFlags enum to map capabilities from MVKMTLFmtCaps to VkFormat.
Derive three VkFormatFeatureFlags in VkFormatProperties from documented
MTLPixelFormat capabilities, customizing based on MTLDevice feature sets.
Include VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT and
VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT in writable features.
MVKPixelFormats modify VkFormatProperties unit test to log differences.
2020-03-23 21:28:36 -04:00
Bill Hollings
06dcf8dc70 Rename mvkDisableFlag() to mvkDisableFlags(). 2020-03-23 16:58:07 -04:00
Bill Hollings
5a5978f021 MVKPixelFormats determine Metal format support from format caps instead of OS version.
MVKPixelFormats build and modify Metal format maps before building Vulkan format maps.
MVKMTLFormatDesc remove sinceOSVersion and isSupported() checks format caps instead.
Remove datafilling of OS versions in MVKMTLFormatDesc.
2020-03-22 21:10:25 -04:00
Bill Hollings
329c1187d5 MVKPixelFormats add MTLVertexFormat capabilities based on MTLDevice feature set. 2020-03-22 18:29:34 -04:00
Bill Hollings
1b09f4a6b1 MVKPixelFormats add MTLPixelFormat capabilities based on MTLDevice feature set. 2020-03-21 21:46:45 -04:00
Bill Hollings
cdbf70d58b Define and populate default MTLPixelFormat capabilities.
MVKPixelFormats improve readability of datafilling of VkFormat, MTLPixelFormat,
and MTLVertexFormat capabilities using dynamic symbol macros to allow abbreviations.
Add MVKMTLFmtCaps enum to track MTLPixelFormat capabilities, and populate table of
default MTLPixelFormat and MTLVertexFormat capabilities.
Add mvkSelectPlatformValue() template function to support
selecting values based on the OS platform.
2020-03-20 20:56:24 -04:00
Bill Hollings
c23fc4f48a
Merge pull request #841 from billhollings/master
Update documentation to clarify that MoltenVK is not a fully-compliant implementation of Vulkan.
2020-03-19 19:48:17 -04:00
Bill Hollings
c1f1dd09d5 Update documentation to clarify that MoltenVK is not a fully-compliant implementation of Vulkan. 2020-03-19 18:01:05 -04:00
Bill Hollings
90970d4581
Merge pull request #840 from billhollings/master
Use MVKPixelFormats for all internal Vulkan and Metal format management.
2020-03-19 17:48:20 -04:00
Bill Hollings
f58cb03ef9 MVKPixelFormats trim format descriptor population functions. 2020-03-17 13:01:03 -04:00
Bill Hollings
a2e995e5b2 Refactor and rename MVKPixelFormat getDesc...() functions. 2020-03-17 11:14:52 -04:00
Bill Hollings
bb69a5bfc6 Refactor MVKPixelFormat internals.
Split MVKFormatDesc struct into separate MVKVkFormatDesc & MVKMTLFormatDesc structs.
Separate content into Vulkan and Metal format tables.
2020-03-17 10:39:49 -04:00
Bill Hollings
1f74a6f20d Replace use of misc global pixel functions with MVKPixelFormats versions.
Remove mvkMTLVertexFormatFromVkFormatInObj()
and mvkEnumerateSupportedFormats() functions.
2020-03-16 11:45:16 -04:00
Bill Hollings
cdd9fcb18c Replace use of global clear value functions with MVKPixelFormats versions.
MVKPixelFormats add getMTLClearDepthFromVkClearValue()
and getMTLClearDepthFromVkClearValue().
2020-03-15 21:59:42 -04:00
Bill Hollings
fff2c43d47 Replace use of global format properties and
names functions with MVKPixelFormats versions.

Remove MVKPhysicalDevice::getFormatIsSupported().
2020-03-15 21:36:24 -04:00
Bill Hollings
0979151881 Replace use of global texel, block, row, and image
sizing functions with MVKPixelFormats versions.
2020-03-15 21:14:35 -04:00
Bill Hollings
c2ebbc732f Replace use of mvkMTLPixelFormatFromVkFormat() and mvkVkFormatFromMTLPixelFormat()
with MVKPixelFormats versions.

Remove mvkMTLPixelFormatFromVkFormatInObj().
2020-03-15 20:48:39 -04:00
Bill Hollings
e596e4c105 Replace use of mvkFormatTypeFromMTLPixelFormat() with
MVKPixelFormats::getFormatTypeFromMTLPixelFormat.
2020-03-15 20:15:24 -04:00
Bill Hollings
fb6f38e423 Replace use of mvkFormatTypeFromVkFormat() with MVKPixelFormats::getFormatTypeFromVkFormat. 2020-03-15 20:10:31 -04:00
Bill Hollings
fd4ad6ec54 Replace use of bool global format calls with calls to MVKPixelFormats. 2020-03-15 19:54:57 -04:00
Bill Hollings
0a8086cbc7 Support MVKPixelFormats in MVKDevice, MVKDeviceTrackingMixin, and MVKCommand.
Replace getMTLPixelFormatFromVkFormat() in MVKDevice, MVKDeviceTrackingMixin
and MVKCommand with access to getPixelFormats().
Add mvkPlatformPixelFormats() to support default platform pixel format info.
Rename MVKFormatDesc to MVKPlatformFormatDesc in mvk_datatypes.mm to avoid
naming conflict.
2020-03-15 19:12:39 -04:00
Bill Hollings
e8c90be681
Merge pull request #839 from billhollings/master
Fixes to memory management and pixel format tracking.
2020-03-14 17:37:15 -04:00