1833 Commits

Author SHA1 Message Date
Chris Dalton
54f0b23d4a Separate "pixel" and "buffer" features in MVK_MAKE_FMT_STRUCT
This will allow us to vary these feature flags independently.

Helps to fix #147
2018-05-02 12:59:49 -06:00
Chris Dalton
2f0c9f6c04 Initialize invalid MVKFormatDescs with MVK_FMT_NO_FEATS
As the feature flags get more complicated, it will be better to just
leave these blank rather than guess what the flags might be if/when
Metal supports their corresponding configs in the future.

Helps to fix #147
2018-05-02 12:59:49 -06:00
Hanton Yang
723fa9650d Separate categories from MVKOSExtensions.
MTLTextureDescriptor+MoltenVK
MTLSamplerDescriptor+MoltenVK
CAMetalLayer+MoltenVK
2018-04-27 23:04:28 +08:00
Bill Hollings
72f1efa674 Don't use CAMetalLayer displaySyncEnabled property if it is not available.
Update version to 1.0.4.
2018-04-22 23:16:52 -04:00
Bill Hollings
a80a85f82f MVKCmdClearAttachments & MVKCmdClearImage support multisampled attachments and images. 2018-04-19 18:36:00 -04:00
Bill Hollings
164680b686 Support depth clip mode only from MTLFeatureSet_iOS_GPUFamily2_v4 onwards. 2018-04-18 20:48:34 -04:00
Bill Hollings
bb2188c083 Add support for VK_PRESENT_MODE_IMMEDIATE_KHR swapchain presentation mode. 2018-04-18 20:16:45 -04:00
Bill Hollings
9b871d0280 Update to latest LunarG/VulkanSamples and update MoltenVK version to 1.0.3. 2018-04-18 11:06:47 -04:00
Bill Hollings
793f3fdaf3 Add workaround for apps that use one semaphore for all swapchain images.
Support deferred secondary signaling of semaphore & fence acquired while image is free.
Add MVKBaseObject::destroy() function to support customization of object destruction.
Support deferred destruction of MVKSemaphore & MVKFence instances.
2018-04-14 20:12:33 -04:00
Bill Hollings
9fe7e3659a Clean up reference to SDK in dylib build script. 2018-04-09 17:42:51 -04:00
Bill Hollings
796cf7e417 MVKImage::getArrayLayers() reports only layer count and excludes depth. 2018-04-09 16:22:43 -04:00
Bill Hollings
c08e22e097 vkCmdCopyBufferToImage() & vkCmdCopyImageToBuffer() support a VkBuffer
that is bound to an offseted position in a VkDeviceMemory.
2018-04-09 14:26:02 -04:00
Bill Hollings
d58da3a3c8 Queue and device wait idle handled by internal fence instead of semaphore.
Merge handling of timed and infinite synchronizations.
2018-04-05 23:32:35 -04:00
Bill Hollings
9fddb15a53 Round up row and layer byte counts when copying compressed
images with sizes that are not integer multiples of block size.
2018-04-03 17:01:53 -04:00
Bill Hollings
3c6b3ae210 vkCmdClearAttachments() don't attempt to clear non-existing depth & stencil attachments. 2018-03-30 18:28:26 -04:00
Bill Hollings
e4d00447f9 Always clamp scissors to render area to avoid Metal validation error. 2018-03-30 16:44:49 -04:00
Bill Hollings
04849f9f63 Present using command buffer by default.
Update version to 1.0.2.
2018-03-30 16:15:22 -04:00
Bill Hollings
20c98e5e46 Add support for caching converted MSL shader code offline from pipeline cache
via vkGetPipelineCacheData(), vkCreatePipelineCache() & vkMergePipelineCaches().

Add the cereal serialization framework as a dependency.
Update documentation. Update project settings to Xcode 9.3.
2018-03-30 12:13:50 -04:00
Bill Hollings
c45b47183e Shader libraries cached in MVKPipelineCache instead of MVKShaderModule. 2018-03-22 23:52:12 -04:00
Bill Hollings
fd7521dc7b VkPhysicalDeviceProperties::pipelineCacheUUID value derived
from MoltenVK version and highest supported Metal feature set.
2018-03-21 10:17:41 -04:00
Bill Hollings
8fbbaba11f Add option for per-frame performance logging via un-commentable logging code. 2018-03-19 11:44:12 -04:00
Bill Hollings
afebc3fe08 Support SPIR-V containing multiple entry points.
Include name and stage when matching shaders contexts for pipelines.
Avoid deprecated SPIRV-Cross members.
Update to latest SPIRV-Cross version.
2018-03-19 10:58:46 -04:00
Bill Hollings
c77ad3a383 Remove folder symlinks and update MoltenVK version to 1.0.1.
Remove duplicate build of SPIRV-Tools in fetchDependencies.
Remove folder symlinks from Externals and MoltenVKShaderCompiler folders.
Update header search paths to reference External folders directly.
Update External/README.md documentation.
Update MoltenVK version to 1.0.1 to reflect new build instructions.
Minor update to performance logging.
2018-03-18 18:41:19 -04:00
Bill Hollings
a911b63247 Fix memory issues.
Wrap each queue submission in a dedicated @autoreleasepool.
Fix memory leak during creation of global format mappings.
2018-03-15 18:46:56 -04:00
Bill Hollings
9ba039c6d6 Derive vkCmdCopyBuffer() alignment requirement at runtime.
Add MVKPhysicalDeviceMetalFeatures::mtlCopyBufferAlignment.
Set MTLComputeCommandEncoder label based on Vulkan command type.
Add MVKCommandUse::kMVKCommandUseDispatch.
2018-03-14 10:13:19 -04:00
Bill Hollings
7df5a739d5
Merge pull request #93 from mikes-lunarg/mikes_getinstanceprocaddr_null
Fix vkGetInstanceProcAddr to work with 1.1 loader
2018-03-13 14:28:40 -04:00
Bill Hollings
ec4072115f
Merge pull request #99 from mellinoe/fix-vkCmdCopyBuffer
Fix vkCmdCopyBuffer when copying unaligned regions.
2018-03-13 14:20:19 -04:00
Eric Mellino
349ba44ac4 Fix vkCmdCopyBuffer when copying unaligned regions.
* Vulkan allows any valid copy regions to be used in this function.
  However, Metal's blit command encoder only allows copy offsets and
  sizes which are multiples of 4 bytes.
* Before this change, attempting to copy such a region would cause
  Metal validation errors to trigger.
* This adds logic to detect such copy regions and uses a special compute
  shader to perform a byte-by-byte copy from the source buffer to
  the destination buffer with the appropriate offsets.
* This new code path is only needed on macOS, because iOS does not share
  the same copy region restrictions.
2018-03-12 22:50:18 -07:00
Bill Hollings
00fda690ca Align versioning of external libraries with those used by LunarG SDK.
Load external library versions using script instead of Git submodules.
SPIRV-Cross, Vulkan-LoaderAndValidationLayers & VulkanSamples versions recorded in files.
glslang version determined by Vulkan-LoaderAndValidationLayers.
SPIRV-Tools & SPIRV-Headers versions loaded by glslang.
When MoltenVK is built as part of the LunarG SDK, use external libraries
sourced from parent Vulkan-LoaderAndValidationLayers.
Use Vulkan headers from Vulkan-LoaderAndValidationLayers.
No longer generate Vulkan specification.
Update documentation.
2018-03-12 10:02:13 -04:00
Mike Schuchardt
dc0679f612 Fix vkGetInstanceProcAddr to work with 1.1 loader
In order to determine the instance version, the 1.1 loader takes
advantage of the fact that a 1.0 ICD will return NULL for
vkGetInstanceProcAddr(NULL, "vkEnumerateInstanceVersion")
2018-03-09 14:26:30 -07:00
Bill Hollings
26967d4fa1 Update compile warnings originating from use of __printflike. 2018-03-01 20:07:37 -05:00
C.W. Betts
0c91b1e613 Add printf-like macros to MVKLogImpl and mvkNotifyErrorWithText.
This will make the compiler point out improper formatting of variadic functions.
2018-02-26 15:28:28 -07:00
Bill Hollings
e67cf9c0f2 Support null VkSubmitInfo on queue submit. 2018-02-25 15:52:09 -05:00
Bill Hollings
73ff9161e1 Support VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT on VkFormats
that are not supported as texture formats under Metal.
2018-02-25 11:49:58 -05:00
Bill Hollings
7e491e5c04 On command buffer submission, defer waiting on semaphores
until just before MTLCommandBuffer is committed.

Add presentWithCommandBuffer config option to choose how to present.
2018-02-25 01:05:08 -05:00
Bill Hollings
83027ca638 Update version to 1.0.0. 2018-02-24 19:59:58 -05:00
Bill Hollings
615d3f8e2a Consolidate timestamps and performance tracking.
Update to latest SPIRV-Cross.
2018-02-24 19:51:43 -05:00
Bill Hollings
a4e4222140 Populate VkPhysicalDeviceProperties vendorID, deviceID and pipelineCacheUUID.
Fix MVKShaderLibrary missing function prototype warning.
Update to latest SPIRV-Cross.
Update to latest Vulkan-Hpp.
Update to latest Vulkan-LoaderAndValidationLayers.
2018-02-21 14:24:21 -05:00
Maximilian Maldacker
e3741004b4 moved spe constant work group size reading at the end 2018-02-15 22:49:08 +01:00
Maximilian Maldacker
6eecd58ad2 added workgroupssize specialization constants 2018-02-15 19:00:24 +01:00
Bill Hollings
68b31e6361 Fix push constant data copying and update to latest SPIRV-Cross. 2018-02-14 13:52:53 -05:00
Bill Hollings
099b6de13e
Merge pull request #49 from mmaldacker/bugfix/push_constant_offset
push constant offset
2018-02-14 13:20:45 -05:00
Maximilian Maldacker
529b3d1e8e added missing break statements 2018-02-13 22:54:03 +01:00
Maximilian Maldacker
c6723a187b don't align push constant buffer (otherwise it'll overwrite other push constants) 2018-02-13 22:53:17 +01:00
Karl Schultz
c4ce08402d Disable watermark in debug builds 2018-02-13 12:47:18 -07:00
Bill Hollings
433632abc1
Merge pull request #42 from mmaldacker/bugfix/texture_synchronize
don't check if texture is coherent since it never is on macOS
2018-02-13 11:14:38 -05:00
Maximilian Maldacker
93e20e28d3 check if storage mode is not shared when checking if synchronize is needed 2018-02-13 12:39:26 +01:00
Maximilian Maldacker
dcb08d262c setup push constants for compute shaders 2018-02-08 21:36:42 +01:00
Maximilian Maldacker
c0355293c3 don't check if texture is coherent since it never is on macOS 2018-02-08 21:35:30 +01:00
Bill Hollings
5beaf7af01 Combine multiple VkCommandBuffers into a single MTLCommandBuffer. 2018-02-06 11:49:51 -05:00