1301 Commits

Author SHA1 Message Date
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
Bill Hollings
7658bccfba Fix memory leak when pre-filling MTLCommandBuffers.
Wrap MVKCommandBuffer::prefill() in autoreleasepool.
For non-reusable MVKCommandBuffers, release command instances
once prefilling is done to reduce memory pressure.
2020-03-14 16:56:12 -04:00
Bill Hollings
30658f05f5 Add ability to disable command memory pooling using MVK_CONFIG_USE_COMMAND_POOLING
environment variable.

Add ability to track MVKObjectPool allocation and pool residency counts.
2020-03-11 17:50:49 -04:00
Bill Hollings
bf4d121897 Manage MTLPixelFormatDepth24Unorm_Stencil8 support via MVKPixelFormats.
MVKPhysicalDevice hold instance of MVKPixelFormats.
Remove known unsupported from mvkMTLPixelFormatFromVkFormatInObj();
2020-03-10 11:50:20 -04:00
Bill Hollings
e9bbea96d1 Rename MVKFormats to MVKPixelFormats. 2020-03-10 08:38:43 -04:00
Bill Hollings
a9e5cb2914 Add initial MVKFormats class to manage Vulkan and Metal formats. 2020-03-08 14:50:37 -04:00
Bill Hollings
573fd67d93 Fixes to use of mvkClear() & mvkCopy().
Change mvkClear() & mvkCopy() to accept array size.
Fix clearing of array content using mvkClear().
Update number of VkDynamicStates that can be tracked.
Change copying of sizeable structs in vk_mvk_moltenvk.mm.
Add mvkAreEqual() to compare values, structs and arrays.
2020-03-07 17:11:55 -05:00
Bill Hollings
dffbf92c84
Merge pull request #834 from billhollings/master
Fix Metal validation assertion on VkPhysicalDeviceLimits::minStorageBufferOffsetAlignment
2020-03-03 22:04:30 -05:00
Bill Hollings
9e0ed9fbf4 Increase value of VkPhysicalDeviceLimits::minStorageBufferOffsetAlignment
to 16 to avoid Metal validation assertions.
2020-03-03 18:07:26 -05:00
Bill Hollings
75e70a762c
Merge pull request #833 from billhollings/master
Guard against Metal validation assertion from reuse of query number
2020-03-03 18:03:40 -05:00
Bill Hollings
8ac99ec0c5 Include thread ID and name when logging Vulkan calls. 2020-02-18 16:26:55 -05:00
Bill Hollings
860e1ef2fb MVKOcclusionQueryCommandEncoderState validate occlusion query during encoding step. 2020-02-16 17:10:30 -05:00
Bill Hollings
73984ba20c Guard against Metal validation assertion from reuse of
query number within a single MTLRenderEncoder.

Track MTLRenderEncoder used for each query and validate query is not reused within the
scope of a single MTLRenderEncoder, logging error and ending current query if encountered.
Remove _t from pre-typedef struct declarations.
Move declaration of MVKSwapchainImageAvailability from MVKImage.h to MVKSwapchain.h.
Update What's New document.
2020-02-15 21:49:13 -05:00
Bill Hollings
bfde6183f9
Merge pull request #827 from billhollings/master
Fix issue where immutable samplers are removed during descriptor update.
2020-02-11 22:33:48 -05:00
Bill Hollings
d7574d879d Fix issue where immutable samplers are removed during descriptor update.
Suppress spurious debug message.
Minor syntax fix.
Update MoltenVK version to 1.0.41.
2020-02-04 12:56:13 -05:00
Bill Hollings
fd7b69b9e5
Merge pull request #820 from billhollings/master
Update dependency libraries to match Vulkan SDK 1.2.131.
2020-01-22 11:21:30 -05:00
Bill Hollings
71c3b4da75 Update Templates/spirv-tools/build.zip. 2020-01-22 09:14:51 -05:00
Bill Hollings
0c754fb036 Update dependency libraries to match Vulkan SDK 1.2.131.
Update What's New document.
2020-01-21 19:14:14 -05:00
Bill Hollings
0d94a8e86d
Merge pull request #819 from billhollings/master
Fix issue where preallocated descriptor count was not reset during vkResetDescriptorPool().
2020-01-21 14:51:50 -05:00
Bill Hollings
593f773f48 Fix issue where preallocated descriptor count was not reset during vkResetDescriptorPool().
Document MVK_CONFIG_PREALLOCATE_DESCRIPTORS runtime environment variable.
Update MoltenVK_Runtime_UserGuide.md to better explain runtime environment variables.
Update Whats_New.md document.
2020-01-21 14:05:58 -05:00
Bill Hollings
8463eb5d8d
Merge pull request #818 from billhollings/master
Support preallocated descriptor pooling via VkDescriptorPoolSize.
2020-01-21 10:15:07 -05:00
Bill Hollings
7eba92b208
Merge pull request #815 from Cry-Mory/master
Adds support for vkGetMTLBufferMVK
2020-01-21 09:30:11 -05:00
Bill Hollings
6abf4a6e2f Support preallocated descriptor pooling via VkDescriptorPoolSize.
Add MVK_CONFIG_PREALLOCATE_DESCRIPTORS env var to enable descriptor preallocation
in pool. Add MVKDescriptor subclasses for all used VkDescriptorType values.
Support allocating MVKDescriptor subclasses via direct instantiation,
or referencing preallocated instances held in a fixed collection.
MVKDescriptor subclasses support resetting and reuse from preallocated collection.
MVKDescriptorPool optionally holds collections of preallocated descriptors,
one collection per VkDescriptorType value.
Support VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT to mark preallocated
descriptors as available when freed.
2020-01-21 09:18:18 -05:00
Bill Hollings
e53e582639 Move MVKDescriptor instantiation to MVKDescriptorPool and support allocation failures. 2020-01-15 16:29:14 -05:00