317 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
9e0ed9fbf4 Increase value of VkPhysicalDeviceLimits::minStorageBufferOffsetAlignment
to 16 to avoid Metal validation assertions.
2020-03-03 18:07:26 -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
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
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
8ec682938b Update copyright to 2020. 2020-01-07 16:47:29 -05:00
Bill Hollings
7fb0880374 Document recommendation to use 3 swapchain images, particularly with full-screen rendering. 2020-01-07 13:50:35 -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
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
a64f62ee53 Update dependency libraries to match Vulkan SDK 1.1.130.
Update ExternalRevisions/README.md to document new glslang build settings.
Update What's New document.
2019-12-16 14:24:57 -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
b213996c5e Support Xcode 11.3.
Update What's New document.
2019-12-12 12:38:17 -05:00
Bill Hollings
98e0b79a52 Fix inconsistency in reporting device local memory between type and heap on macOS. 2019-12-06 10:18:13 -05:00
Bill Hollings
5b1425b73d Cube demo use VK_EXT_metal_surface extension. 2019-12-02 13:46:31 -05:00
Bill Hollings
9f64cc4bef Fix tessellation break when control stage declares but does not use position builtin.
Add SPIRVShaderOutput::isUsed retrieved from shader reflection.
mvk::sizeOfOutput() returns zero if output var is not used.
Update to latest SPIRV-Cross version.
2019-11-26 16:11:52 -05:00
Michael Barriault
ddf108153d Support for EXT_inline_uniform_block 2019-11-25 21:35:38 +00:00
Bill Hollings
3bb70e8749 Fix MTLHeap memory leak in MVKDeviceMemory. 2019-11-18 13:06:05 -05:00
Bill Hollings
15cdb32ae9 Fix image subresource sizing calculations for heap-based textures.
Add MVKImage::_rowByteAlignment separate from _byteAlignment.
2019-11-16 19:05:44 -05:00
Bill Hollings
ddfa225f79 Fix crash in fetchDependencies on build paths containing spaces. 2019-11-14 17:11:10 -05:00
Bill Hollings
0b6916aa23 Clamp image copy extents to image extent. 2019-11-13 15:40:43 -05:00
Bill Hollings
9b13006018 Support linear filtering when using vkCmdBlitImage().
Fixes linear filtering when using vkCmdBlitImage(), useful for mipmap generation.
Move MVKCmdBlitImage sampler definition to shader as a constexpr sampler,
and ensure mip_filter and filter are set correctly.
Add MVKRPSKeyBlitImg::srcFilter.
Include MVKCommonEnvironment.h in MVKLogging.h.
Update MoltenVK version to 1.0.39.
2019-11-12 16:47:33 -05:00
Bill Hollings
f97b827fa5 Update What's New document. 2019-10-30 17:08:16 -04:00
Bill Hollings
d96ee9b0ca Fix severe FPS degradation caused by certain swapchain recreation situations.
Ensure swapchain clears all cached CAMetalDrawables when destroyed.
2019-10-30 14:18:11 -04:00
Bill Hollings
0b1189dc03 Update external libraries to support Vulkan SDK 1.1.126.
Update What's New document.
2019-10-29 11:55:16 -04:00
Bill Hollings
93ae214bc8 Support additional capabilities in 1D images, including rendering, clearing, and mipmaps.
Add `MVK_CONFIG_TEXTURE_1D_AS_2D` environment variable, enabled by default.
Modify 1D warning messages to recommend use of `MVK_CONFIG_TEXTURE_1D_AS_2D`.
Update to latest version of SPIRV-Cross.
Align pipeline cache contents to latest CompilerMSL::Options structure.
Clean up code signing on demo Xcode projects.
2019-10-25 14:40:59 -04:00
Bill Hollings
47d38df764 Log format substitution error when MTLPixelFormatDepth24Unorm_Stencil8 is not supported. 2019-10-17 16:59:52 -04:00
Bill Hollings
f14e44800a Enable use of MTLFence for Vulkan semaphores, by default. 2019-10-17 15:16:16 -04:00
Bill Hollings
c6ea99e4db Support Metal 3.0.
Merge Metal-3.0 branch into master branch.
Update What's New document with merged features.
2019-10-16 18:26:58 -04:00
Bill Hollings
ebe38ba2ea Reduce memory usage by replacing use of MVKVectorDefault
with std::vector in descriptor set bindings.
2019-10-11 15:12:17 -04:00
Bill Hollings
5c87700732 Reduce memory usage by adjusting default memory allocs for many MVKVectorInline uses.
MVKRenderPass use emplace_back() instead of push_back()
when populating _subpasses  & _attachments vectors.
Add mvkLogSizeOf(T) development debugging function.
2019-10-10 16:46:17 -04:00
Bill Hollings
1d628baca4 Fix memory leaks when compiling shaders and pipelines without default OS autorelease pool.
Wrap MVKMetalCompiler compiling execution in an @autoreleasepool.
2019-10-07 18:52:24 -04:00
Bill Hollings
62fa0d4a65 Fix memory leaks of system classes during VkInstance and VkQueue creation.
Wrap retrieval of MTLDevice and MTLCommandQueue in an @autoreleasepool.
2019-10-04 13:26:04 -04:00
Bill Hollings
a2951a19e6 Support Xcode 11.
Declare _formatDescriptions[] in mvk_datatypes.mm as officially writable
because Clang now locates static const in non-writable memory.
Update build settings to Xcode 11.
Update MoltenVK_Runtime_UserGuide.md about embedding `libMoltenVK.dylib` in an application.
2019-10-01 00:25:09 -04:00
Bill Hollings
b805ccf702 Allow MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS build setting to be overridden. 2019-09-26 15:28:30 -05:00
Bill Hollings
9f7eeb46a0 Clarify static linking as the recommended linking approach for iOS app store distribution. 2019-09-25 19:04:33 -05:00
Bill Hollings
5c7904c3a7 Add request for feedback from people who reject MoltenVK to README.md document.
Update MoltenVK version to 1.0.38.
2019-09-25 15:41:40 -05:00
Bill Hollings
5636233f47 Report error only on the first time a format substitution is made. 2019-09-10 15:40:18 -04:00