1105 Commits

Author SHA1 Message Date
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
a87ef6bc77
Merge pull request #723 from billhollings/master
Track supported instance and device extensions correctly.
2019-08-18 23:45:44 -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
8fd5e183f2
Merge pull request #722 from billhollings/master
Fixes to issues found during CTS testing
2019-08-17 12:30:22 -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
0bc3be3707
Merge pull request #718 from billhollings/master
vkCmdBlitImage() fix test for different sample counts.
2019-08-12 23:55:56 -04:00
Bill Hollings
95e805c8c2 vkCmdBlitImage() fix test for different sample counts. 2019-08-12 23:55:18 -04:00
Bill Hollings
95f5b58145
Merge pull request #717 from billhollings/master
Fixes to vkCmdBlitImage() & vkCmdClearImage().
2019-08-12 17:50:44 -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
b6328641a4
Merge pull request #715 from billhollings/master
Add ability to automatically cause an Xcode GPU capture without developer intervention.
2019-08-11 20:16:23 -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
8db6177cf8
Merge pull request #714 from billhollings/master
Fix crash in vkDestroyPipelineLayout()
2019-08-10 00:02:04 -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
Bill Hollings
0fc3036983 Fix crash in vkDestroyPipelineLayout().
MVKPipelineLayout hold retained/released pointers to MVKDescriptorSetLayout,
instead of copies of MVKDescriptorSetLayout instances.
2019-08-09 14:48:24 -04:00
Bill Hollings
ce3757a56e Merge branch 'master' of https://github.com/KhronosGroup/MoltenVK 2019-08-09 14:32:38 -04:00
Bill Hollings
1c02662afa
Merge pull request #712 from cdavis5e/device-group
Support the VK_KHR_device_group extension.
2019-08-09 14:31:10 -04:00
Chip Davis
100d7aa543 Support the VK_KHR_device_group extension.
Largely minimal for now. Much of it, particularly most of the
interactions with `VK_KHR_swapchain`, was already implemented
previously. The only interesting bits are the `vkCmdDispatchBase()`
command, and the ability to create arbitrary swapchain images and bind
them to swapchain memory, which requires the use of the previously
implemented `VK_KHR_bind_memory2` extension. Most everything else can be
safely ignored for now.

Non-zero dispatch bases use the compute stage-input region to pass the
dispatch base group to the shader, which must manually adjust the
`WorkgroupId` and `GlobalInvocationId` builtins, since Metal does not do
this for us. I have tested that this approach works well--at least, well
enough to pass the CTS.

Because of the ability to bind arbitrary images to swapchain memory,
I've sucked the guts out of `MVKSwapchainImage` and into `MVKSwapchain`
itself. Availability and drawable management is now performed by the
swapchain object. `MVKSwapchainImage` is now just a specialized kind of
image, created when requested with a `VkImageCreateSwapchainInfoKHR`
structure.

Update SPIRV-Cross so we can support the `vkCmdDispatchBase()` command.

One more step towards Vulkan 1.1.
2019-08-09 11:41:10 -05:00
Bill Hollings
75b4c27d14 Merge branch 'master' of https://github.com/KhronosGroup/MoltenVK 2019-08-09 10:59:08 -04:00
Bill Hollings
f43169e441
Merge pull request #709 from cdavis5e/buffer-no-prefer-dedicated
Don't prefer dedicated allocations for buffer memory.
2019-08-09 10:55:55 -04:00
Bill Hollings
a93595e743
Merge pull request #708 from billhollings/master
Add support for VkEvent.
2019-08-09 10:55:02 -04:00
Chip Davis
28fb7be085 MVKImage: Don't prefer dedicated allocations for buffer-backed images.
For the same reason we don't prefer them for buffers.
2019-08-08 23:42:12 -05:00
Bill Hollings
769e8877ad
Merge pull request #707 from cdavis5e/swapchain-composite-alpha
MVKSwapchain: Add handling for compositeAlpha.
2019-08-08 23:21:59 -04:00
Bill Hollings
95def90d06 Remove error logging on VK_TIMEOUT of VkSemaphore and VkFence. 2019-08-08 17:10:35 -04:00
Chip Davis
db1b5a464c MVKBuffer: Don't prefer dedicated allocations.
We always just use the underlying `MTLBuffer` in the `MVKDeviceMemory`
anyway. Dedicated allocations don't really buy us anything here.
2019-08-08 15:17:05 -05:00
Chip Davis
f601e923bd MVKSwapchain: Add handling for compositeAlpha.
Set the `opaque` property of the `CAMetalLayer` based on this. In the
past, we did nothing; this actually corresponds to
`VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR`.

Drop support for premultiplied alpha. In Core Animation, this is managed
by the `contents` of the layer. Most layers use a `CGImage` or an
`NSImage` for their contents; the `AlphaInfo` property of a `CGImage`
determines whether or not it uses premultiplied alpha. However,
`CAMetalLayer` doesn't use a `CGImage`, but a custom opaque Core
Foundation object which ostensibly vends images to be displayed by the
layer. I don't know which kind of alpha it uses, but since most
applications render postmultiplied colors I'm going to assume that
premultiplied alpha isn't supported yet.
2019-08-08 15:14:55 -05:00
Bill Hollings
7dc642196a Add support for VkEvent.
Add MVKEvent class. MVKEventNative subclass uses native MTLEvent. MVKEventEmulated
subclass uses emulation using CPU blocking and MTLCommandBuffer completion handling.
MVKConfiguration::synchronousQueueSubmits now disabled by default if MTLEvents are not supported.
Document updated use of MVK_ALLOW_METAL_EVENTS and MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS
environment variables and synchronousQueueSubmits config setting, in vk_mvk_moltenvk.h.
2019-08-08 16:13:47 -04:00
Bill Hollings
e38b7e7d90
Merge pull request #699 from billhollings/master
Fix crash when VkDeviceCreateInfo specifies queue families out of numerical order.
2019-08-05 16:47:09 -04:00
Bill Hollings
1745bfee98 Fix crash when VkDeviceCreateInfo specifies queue families out of numerical order.
MVKDevice check highest queue family index before expanding queue family collection.
MVKVector add bounds check to at(), [], front() & back() functions.
2019-08-05 15:49:08 -04:00
Bill Hollings
ff671179a3
Merge pull request #696 from billhollings/master
Two code structural design improvements: MVKVector & MVKLinkableMixin
2019-08-02 10:30:42 -04:00
Bill Hollings
e904d63138 Use MVKVector whenever possible in MoltenVK, especially within render loop.
Minor fixes and extensions to MVKVector implementations.
2019-08-01 15:05:01 -04:00
Bill Hollings
da7a4420f5 Consolidate the various linkable objects into a MVKLinkableMixin template base class.
Update MoltenVK version number to 1.0.37.
2019-07-30 00:54:27 -04:00
Bill Hollings
ef14a14faa
Merge pull request #690 from billhollings/master
Host-coherent memory for linear images again, plus Vulkan loader magic number fix.
2019-07-29 22:29:43 -04:00
Bill Hollings
c857014bb3 Ensure Vulkan loader magic number persists in objects pooled by MoltenVK.
MVKDispatchableVulkanAPIObject::getVkHandle() re-establishes the loader magic number
before returning, in case the loader overwrote it before returning the object.
2019-07-29 17:50:42 -04:00
Bill Hollings
355e200a29 Revert to supporting host-coherent memory for linear images on macOS.
MVKImage::getMemoryRequirements() include host-coherent for linear images.
Cube demo on macOS not use staging buffers for loading images.
2019-07-29 15:52:24 -04:00
Bill Hollings
73cbc80716
Merge pull request #685 from billhollings/master
Update to latest version of SPIRV-Cross.
2019-07-24 17:18:20 -04:00
Bill Hollings
095dd3339b Update to latest version of SPIRV-Cross.
Update demos to latest dependency library versions.
Update to Xcode 10.3.
Update What's New document.
2019-07-24 14:39:38 -04:00
Bill Hollings
a945872cf3
Merge pull request #683 from billhollings/master
Updates for SDK 1.1.114 release.
2019-07-23 17:22:40 -04:00
Bill Hollings
2f468db9a2 Updates for SDK 1.1.114 release.
Update to latest external dependency libraries.
Rename components of VK_INTEL_shader_integer_functions2 to match 1.1.114 Vulkan spec.
Update What's New document.
2019-07-23 14:29:32 -04:00
Bill Hollings
4e4bf617c6
Merge pull request #682 from billhollings/master
Fix crash when binding descriptor set, plus several CTS fixes
2019-07-22 23:42:17 -04:00
Bill Hollings
232520a4c8 Merge branch 'master' of https://github.com/KhronosGroup/MoltenVK 2019-07-22 15:54:47 -04:00
Bill Hollings
1a9b0cba51 Fix crash when binding descriptor set to layout that has been destroyed and recreated.
Remove the descriptor set pool associated with a MVKDescriptorSetLayout when the layout
is destroyed. MVKDescriptorPool and MVKDescriptorSetLayout track each other to tell the
other when it has been destroyed.
2019-07-22 15:53:59 -04:00
Bill Hollings
6cc4b484db Return error when MVKImage created as 1D attachment. 2019-07-19 19:25:54 -04:00
Bill Hollings
6da89d6bbe
Merge pull request #680 from cdavis5e/device-group-creation
Add a minimal implementation of VK_KHR_device_group_creation.
2019-07-19 17:34:20 -04:00
Bill Hollings
9813a4bf92 Merge branch 'master' of https://github.com/KhronosGroup/MoltenVK 2019-07-19 16:44:40 -04:00
Bill Hollings
3271b88b26
Merge pull request #679 from cdavis5e/enable-new-features
Enable features added by recently added extensions.
2019-07-19 16:44:20 -04:00
Chip Davis
9c18530aac Add a minimal implementation of VK_KHR_device_group_creation.
This is the instance half of device-group support. This provides the
means to enumerate all known physical device groups, and to create
grouped logical devices.

This provides just enough to satisfy the Vulkan spec. Metal won't
support this fully until Metal 3.0 in the upcoming macOS 10.15.
2019-07-19 15:39:01 -05:00
Chip Davis
f5ed08eea1 MVKDevice: Enable VK_EXT_scalar_block_layout features. 2019-07-19 13:42:37 -05:00