715 Commits

Author SHA1 Message Date
Bill Hollings
7f83d473ba Merge branch 'master' of https://github.com/KhronosGroup/MoltenVK 2019-11-26 15:18:24 -05:00
Michael Barriault
82f3f226d3 More tab fixes 2019-11-25 21:42:28 +00:00
Michael Barriault
4b1fb88655 Fix tabbing to be consistent. 2019-11-25 21:40:08 +00:00
Michael Barriault
ddf108153d Support for EXT_inline_uniform_block 2019-11-25 21:35:38 +00:00
Bill Hollings
16afd5e37f Make mvkCeilingDivide() a template function. 2019-11-21 16:51:41 -05: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
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
025abe501a Support Xcode 11.2. 2019-11-04 20:39:41 -05: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
Michael Barriault
1178bc57d0 Fix tessellation when using resolve attachments 2019-10-26 20:57:42 +01: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
d726aa043d Set value of VkPhysicalDeviceLimits::maxTexelBufferElements to more realistic value. 2019-10-22 09:06:48 -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
b5b103e75c Fix crashes for Metal 3.0 capabilities.
Don't allocate MTLHeap of zero size.
MVKImage check for device memory when accessing MTLCPUCacheMode..
2019-10-16 18:50:01 -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
c6e9d6b189 Support Xcode 11.1. 2019-10-11 15:16:13 -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
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
b99a2ea53f Merge master 1.0.37 into Metal-3.0 branch. 2019-09-18 14:15:41 -04:00
Bill Hollings
5636233f47 Report error only on the first time a format substitution is made. 2019-09-10 15:40:18 -04:00
Bill Hollings
1a0bf648b9 vkCmdFillBuffer(): Avoid threadgroup Metal validation error on Intel devices.
On Intel devices, Metal reports different values for max threadgroup width
between the pipeline state and device, so conservatively use the minimum of
these two reported values.
2019-09-10 14:41:26 -04:00
Bill Hollings
d585a9819e Updates to support Vulkan SDK 1.1.121.
Remove obsolescence log message for vkCreateMacOSSurfaceMVK()
and vkCreateIOSSurfaceMVK() functions.
Fix test for alignment of invalid pixel formats.
Update dependency libraries to match Vulkan SDK 1.1.121.
Update to renaming of VK_INTEL_shader_integer_functions2
enums and structs in latest Vulkan headers.
Update Whats_New.md document.
2019-09-10 13:25:19 -04:00
Bill Hollings
f8d8f9bd57
Merge pull request #734 from cdavis5e/fragment-shader-interlock
Support the VK_EXT_fragment_shader_interlock extension.
2019-09-07 21:07:26 -04:00
Chip Davis
deaaab8eff Support the VK_EXT_fragment_shader_interlock extension.
This extension allows fragment shaders to delineate critical sections
where pairs of invocations may not execute simultaneously. In Metal, the
nearest equivalent functionality is raster order groups. This
implementation is thus implemented on top of them.

Update SPIRV-Cross to pull in SPIR-V support for this new extension.
2019-09-06 12:52:39 -05:00
aerofly
5a02641fa1 fixes for iOS 13 2019-09-06 11:49:55 +02:00
aerofly
813c5300a1 mvk_vector 2019-09-06 11:48:37 +02:00
Chip Davis
e7e8610a62 MVKDevice: Constant buffer bindings on macOS cannot exceed 64k.
This limitation appears to be have been present all along (cf. Metal
Feature Set Tables, under "Maximum function memory allocation for a
buffer in the constant address space"). I guess we never ran into it
before.

Prompted by #730.
2019-09-03 11:08:04 -05:00
Bill Hollings
fd5f0ada2c Support optional use of MTLFence for Vulkan semaphores via the
MVK_ALLOW_METAL_FENCES environment variable.

Refactor MVKSemaphore class into separate MVKSemaphoreMTLFence,
MVKSemaphoreMTLEvent, and MVKSemaphoreEmulated subclasses.
Add MVK_ALLOW_METAL_FENCES environment variable to optionally
enable using MTLFence for Vulkan semaphores.
Add MVKPhysicalDeviceMetalFeatures::fences to track MTLFence availability.
Update VK_MVK_MOLTENVK_SPEC_VERSION to version 22.
2019-08-31 22:37:33 -04:00
Bill Hollings
399d24c1e2 Improve performance of vkCmdFillBuffer().
Use  parallelism more effectively to massively cover buffer with
multiple full threadgroups, instead of serial looping in shader.
Performance improvement measured at 150x (yes...x not %) on macOS.
MVKCmdFillBuffer move validation test to setContent() instead of encode().
2019-08-31 14:45:21 -04:00
Bill Hollings
a2b5d0dd18 MVKSwapchain::signalWhenAvailable() add autoreleasepool around MTLCommandBuffer use. 2019-08-27 12:04:58 -04:00
Bill Hollings
937813f48e Don't use MTLCommandBuffer push/popDebugGroup if not available.
Log use of MTLEvent for semaphores.
2019-08-27 11:38:32 -04:00
Bill Hollings
bb3cdd7af4 Streamline design and use of MVKSemaphore.
One set of MVKSemaphore::encodeWait() & encodeSignal() functions either use MTLEvent
or not, and are called twice with and without MTLCommandBuffer to handle both cases
of encoded and inline waits and signals.
Always submit surface presentations using MTLCommandBuffer.
MVKConfiguration::presentWithCommandBuffer is now obsolete.
Fix memory leak of MVKQueueCommandBufferSubmissions with no content.
2019-08-26 23:47:55 -04:00
Bill Hollings
98d59025f3 Fix crash when signalling swapchain semaphore using MTLEvent.
Clear out some dead swapchain image code.
2019-08-26 16:10:13 -04:00
Bill Hollings
2b398fe610 Track supported instance and device extensions correctly.
MVKExtensionList add support for identifying and enabling instance or device extensions.
Rename MVKLayer::getExtensionProperties() to getInstanceExtensionProperties() and
MVKLayer::getSupportedExtensions() to getSupportedInstanceExtensions().
2019-08-18 23:17:03 -04:00
Bill Hollings
25acafdb3f Disable depth and/or stencil testing if corresponding attachment is missing.
MVKDepthStencilCommandEncoderState track whether depth and
stencil attachements exist, and modify testing accordingly.
Add MVKMTLDepthStencilDescriptorData::disable() function.
MoltenVK_Runtime_UserGuide.md remove VkEvent as known limitation.
2019-08-15 13:39:34 -04:00
Bill Hollings
e2ce1a6329 vkCreateRenderPass() return VK_ERROR_FORMAT_NOT_SUPPORTED if format not supported. 2019-08-13 17:34:14 -04:00
Bill Hollings
95e805c8c2 vkCmdBlitImage() fix test for different sample counts. 2019-08-12 23:55:18 -04:00
Bill Hollings
74e8af1525 vkCmdBlitImage() support format component swizzling. 2019-08-12 16:35:59 -04:00
Bill Hollings
f824c1a955 vkCmdClearImage() fix validation of depth attachment formats. 2019-08-12 14:45:53 -04:00
Bill Hollings
f93c572001 vkInvalidateMappedMemoryRanges() synchronizes managed device memory to CPU.
Add MVKDevice::invalidateMappedMemoryRanges().
Add MVKMTLBlitEncoder struct.
MVKDevice::getQueue() defaults to queue family zero and queue zero.
2019-08-11 19:59:40 -04:00
Bill Hollings
fdd1c85b50 Add ability to automatically cause an Xcode GPU capture without developer intervention.
Add MVK_CONFIG_AUTO_GPU_CAPTURE_SCOPE env var and build setting.
2019-08-10 15:23:18 -04:00
Bill Hollings
607941ebd7 vkCmdClearImage() set error if attempt made to clear 1D image.
VkPhysicalDevicePortabilitySubsetFeaturesEXTX::events set to true.
2019-08-09 23:10:04 -04:00