818 Commits

Author SHA1 Message Date
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
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
9e0ed9fbf4 Increase value of VkPhysicalDeviceLimits::minStorageBufferOffsetAlignment
to 16 to avoid Metal validation assertions.
2020-03-03 18:07:26 -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
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
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
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
Bill Hollings
3a1b19be51 Rename MVKDescriptorBinding to MVKDescriptor, including subclasses. 2020-01-15 11:48:27 -05:00
Bill Hollings
3a56901460 Do not pool descriptor sets.
MVKDescriptorPool no longer pools MVKDescriptorSet objects, keyed by their layouts.
MVKDescriptorSet are lightweight allocations, and instances are now created and
freed by the corresponding Vulkan commands.
2020-01-15 10:53:03 -05:00
Bill Hollings
b3e41157ab Refactor MVKDescriptorBinding into hierarchy of specialized subclasses.
MVKDescriptorSetLayoutBinding instantiates appropriate MVKDescriptorBinding subclasses.
MVKDescriptorSet hold pointers to MVKDescriptorBinding instead of instances.
2020-01-14 18:50:51 -05:00
Morteza Mostajab
0d8f27d73d Correcting the comment description for vkGetMTLBufferMVK 2020-01-13 20:05:39 +01:00
Bill Hollings
db2ce8a10e Move resource binding from MVKDescriptorSetLayoutBinding to MVKDescriptorBinding.
MVKDescriptorBinding remove tracking of descriptor set and binding layout.
2020-01-10 14:26:38 -05:00
Bill Hollings
2c6f33e793 Each MVKDescriptorBinding respresents only one resource slot.
Remove arrays of slots from MVKDescriptorBinding. For array types, multiple
MVKDescriptorBindings map to one corresponding MVKDescriptorLayoutBinding.
Simplify logic of copying and writing to descriptors.
2020-01-09 17:57:00 -05:00
Morteza Mostajab
d1752cda70 Adds support for vkGetMTLBufferMVK which returns current metal buffer id for a specific vulkan buffer 2020-01-09 20:31:02 +01:00
Bill Hollings
8bca6709a1 Refactor descriptor binding files.
Move MVKDescriptorBinding & MVKDescriptorSetLayoutBinding
to new MVKDescriptorBinding.h/mm files.
2020-01-07 22:25:49 -05:00
Bill Hollings
8ec682938b Update copyright to 2020. 2020-01-07 16:47:29 -05:00
Bill Hollings
e6224803f6 Track performance of CAMetalLayer nextDrawable call.
Add MVKQueuePerformance::nextCAMetalDrawable.
2020-01-06 09:38:14 -05:00
Bill Hollings
537c7b0040 Fix Metal validation error on push constant sizing differences between C and MSL structs.
Add MVKPhysicalDeviceMetalFeatures::pushConstantSizeAlignment, set value to 16 (size of
float4), and ensure push constant buffers have a size that is a multiple of that value.
Update VK_MVK_MOLTENVK_SPEC_VERSION to 24.
2019-12-28 21:13:58 -05:00
Bill Hollings
a5dd0101b2 Rename mvkAlignByteOffset() to mvkAlignByteCount(). 2019-12-28 17:50:53 -05:00
Michael Barriault
c3d8d4e159 Merge buffer and inline unions to fix issue where binding inline descriptor would interfere with future binds on the same set index in the same command buffer (now only used in push case anyway) 2019-12-26 14:07:51 -03:30
Michael Barriault
78ca4655ab Use MTLBuffer when inline uniform block descriptor is written to instead of copying host-side bytes 2019-12-26 14:05:08 -03:30
Michael Barriault
2ccfb29998 Fix EXT_inline_uniform_block when using push descriptor sets 2019-12-26 14:02:43 -03:30
Bill Hollings
e28a1b4b8b Fix buffer offset in vkCmdPushDescriptorSet() for non-dedicated buffer memory. 2019-12-18 18:22:30 -05:00
Bill Hollings
8ad03bf0d5 Fix crash when app does not use queue family zero.
Add MVKDevice::getAnyQueue() to safely find the first available queue.
Update MoltenVK version to 1.0.40.
2019-12-18 16:44:35 -05:00
Bill Hollings
b6aae29a85 Restrict MTLHeap to private or shared storage modes on iOS.
Set heap storage mode and CPU cache mode parameters directly.
2019-12-16 16:53:20 -05:00
Bill Hollings
a7348e2c69 Remove single-GPU condition from GPU unified memory test. 2019-12-16 15:52:50 -05:00
Bill Hollings
5ba074a125 Avoid reading env vars inside library constructor functions. 2019-12-15 21:47:20 -05:00
Bill Hollings
3f025bc63f Fix bug where dynamic shader buffers are overflowing.
Change MVKPhysicalDeviceMetalFeatures::dynamicMTLBuffers from boolean to uint
dynamicMTLBufferSize limit and guard dynamic buffer usage sizes against it.
Update VK_MVK_MOLTENVK_SPEC_VERSION to 23.
2019-12-12 15:46:28 -05:00
Bill Hollings
977a1f4771 Update mvkClear() to support optional length parameter. 2019-12-12 13:07:04 -05:00
Bill Hollings
b213996c5e Support Xcode 11.3.
Update What's New document.
2019-12-12 12:38:17 -05:00