1353 Commits

Author SHA1 Message Date
Bill Hollings
d3e548f3ee MVKCommand setContent() calls take MVKCommandBuffer parameter.
Remove MVKCommand::added().
2020-04-15 20:48:52 -04:00
Bill Hollings
6059efe0f1 MVKCommand remove reference to MVKCommandBuffer. 2020-04-15 16:46:34 -04:00
Bill Hollings
0074963ff9
Merge pull request #861 from cdavis5e/host-coherent-texel-buffers
MVKBuffer: Support texel buffers in "host-coherent" memory on Mac.
2020-04-15 16:23:27 -04:00
Bill Hollings
1dbe31ab1a
Merge pull request #860 from billhollings/master
vkQueuePresentKHR() returns VkResult for each swapchain.
2020-04-15 16:19:32 -04:00
Bill Hollings
e581266cc7 vkQueuePresentKHR() returns VkResult for each swapchain.
Add MVKSwapchain::getSurfaceStatus().
2020-04-15 15:31:29 -04:00
Chip Davis
25a1e056db MVKBuffer: Support texel buffers in "host-coherent" memory on Mac.
According to the Vulkan spec:

> * If `buffer` is a `VkBuffer` not created with the
>   `VK_BUFFER_CREATE_SPARSE_BINDING_BIT` bit set[...] then the
>   `memoryTypeBits` member always contains at least one bit set
>   corresponding to a `VkMemoryType` with a `propertyFlags` that has
>   both the `VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT` bit and the
>   `VK_MEMORY_PROPERTY_HOST_COHERENT_BIT` bit set. In other words,
>   mappable coherent memory **can** always be attached to these
>   objects.

There is no exception for texel buffers. Even though desktop Metal
disallows textures in shared memory, even linear textures created from a
buffer, we have to advertise host-coherent memory for texel buffers.
Some applications actually depend on this behavior, so it's not just a
theoretical concern.

To support host-coherent texel buffers, we implicitly create a managed
buffer and copy data between the device memory and the managed buffer,
just like for a linear image.

Signed-off-by: Chip Davis <cdavis@codeweavers.com>
2020-04-15 14:31:14 -05:00
Bill Hollings
683928a6fa
Merge pull request #859 from cdavis5e/fix-disable-frag-outputs
Update SPIRV-Cross again to pull in a fix for KhronosGroup/SPIRV-Cross#1322.
2020-04-15 15:13:20 -04:00
Chip Davis
06662071a4 Update SPIRV-Cross again to pull in a fix for KhronosGroup/SPIRV-Cross#1322. 2020-04-15 13:40:44 -05:00
Bill Hollings
49edc524f2
Merge pull request #856 from cdavis5e/disable-frag-outputs
MVKPipeline: Disable fragment shader outputs for unused attachments.
2020-04-15 09:02:47 -04:00
Chip Davis
adf63bbdc7 MVKPipeline: Disable fragment shader outputs for unused attachments.
Naturally, Metal complains when a fragment shader write to a
`[[depth]]` output, but there be no depth attachment. I imagine that it
will also complain if the shader write to ``[[stencil]]`` with no
stencil attachment, or it write to a ``[[color(n)]]`` output with no
corresponding attachment.
2020-04-14 14:32:00 -05:00
Chip Davis
4b479fefd4 Update SPIRV-Cross. 2020-04-14 14:32:00 -05:00
Bill Hollings
b18c56ac1e
Merge pull request #855 from billhollings/master
Reinstate VulkanSamples API-Samples demo apps.
2020-04-12 13:24:24 -04:00
Bill Hollings
2b2bfc3fbd Move generation of API-Samples SPIR-V header files out of fetchDependencies.
Add Demos/LunarG-VulkanSamples/API-Samples/generateSPIRVShaders script.
Update user documentation.
2020-04-12 12:53:17 -04:00
Bill Hollings
b582b9284b Set format capabilities for subpass input attachments to kMVKMTLFmtCapsRead. 2020-04-11 21:58:52 -04:00
Bill Hollings
bd35b76b8d API-Samples demos add input_attachment and push_descriptors demos. 2020-04-11 21:45:47 -04:00
Bill Hollings
eb99488f04 Reinstate VulkanSamples API-Samples demo apps.
MVKShaderConverterTool add support to output SPIR-V as header (.h) files.
Add MVKShaderConverterTool Xcode target.
Add MVKShaderConverterTool Package Xcode scheme.
fetchDependencies builds MVKShaderConverterTool and runs
it on shader files in VulkanSamples API-Samples directory.
2020-04-11 16:19:03 -04:00
Bill Hollings
7d779a1636 Reduce thread locking on performance statistics collection. 2020-04-10 12:18:25 -04:00
Bill Hollings
0904c49014 Alphabetize file sorting in Xcode Project Navigator. 2020-04-09 14:19:46 -04:00
Bill Hollings
dc7eab64ae Consolidate frame and non-frame performance reporting.
Added MVKQueuePerformance::frameInterval performance tracker.
Added MVKPerformanceTracker::latestDuration to track duration of most recent activity.
Swapchain performance can be retrieved with other activity performance through
vkGetPerformanceStatisticsMVK().
Performance logging of all activities can be performed periodically
on a frame-count basis, or inline as the activity occurs.
Add MVK_CONFIG_PERFORMANCE_LOGGING_INLINE env var to enable/disable
logging of performance of each activity when it happens.
Removed vkGetSwapchainPerformanceMVK() and MVKSwapchainPerformance from API.
Updated VK_MVK_MOLTENVK_SPEC_VERSION to 25.
Updated MoltenVK version to 1.0.42.
2020-04-09 14:02:08 -04:00
Bill Hollings
1a25de5500
Merge pull request #852 from billhollings/master
Various fixes resulting from testing for SDK release.
2020-04-05 21:30:02 -04:00
Bill Hollings
a644c98864 Disable API-Samples demos and document in Demos/README.md. 2020-04-05 20:44:44 -04:00
Bill Hollings
70bf788f9f Fix issue of reseting CAMetalDrawable and MTLTexture of peer swapchain images.
Add MVKPresentableSwapchainImage and MVKPeerSwapchainImage subclasses to
MVKSwapchainImage, with MVKPresentableSwapchainImage instances created inside
swapchain, and MVKPeerSwapchainImage instances created using vkCreateImage().
MVKPeerSwapchainImage retrieve and share CAMetalDrawable from corresponding
MVKPresentableSwapchainImage.
2020-04-05 15:15:24 -04:00
Bill Hollings
aa27fd6588 MVKSwapchainImage always retrieve MTLTexture directly from CAMetalDrawable. 2020-04-04 20:25:23 -04:00
Bill Hollings
c6b642db19 Fix acquisition ordering of swapchain images.
Remove obsolete MVKSwapchainImageAvailability::waitCount member that was initializing
randomly and corrupting swapchain image acquisition ordering evaluations.
Rename several member functions to clarify purpose.
2020-04-04 16:25:13 -04:00
Bill Hollings
d46b2f3036 Disable use of MTLHeap by default.
Add MVK_CONFIG_USE_MTLHEAP environment variable to enable use of MTLHeap if needed.
Minor fixes to consistent use of MVK_SET_FROM_ENV_OR_BUILD_BOOL().
2020-04-03 16:55:10 -04:00
Bill Hollings
2352ae1d26
Merge pull request #851 from billhollings/master
Update to Vulkan SDK 1.2.135 library dependencies.
2020-04-03 15:32:43 -04:00
Bill Hollings
1c05cd4386 Travis script use Xcode 11.3. 2020-04-03 14:58:25 -04:00
Bill Hollings
04deb5bbbb Update Travis script.
Avoid caching External directory and force dependencies build every time.
Travis use Xcode 11.4.
2020-04-03 14:15:18 -04:00
Bill Hollings
23818e30ec Fixes for the make install build command.
Fix the make install build command to overwrite the existing framework
in the system framework library.
Update README.md to clarify the instructions for using make install.
2020-04-02 21:11:14 -04:00
Bill Hollings
d57c3c845e vkCreateInstance() return error on incompatible Vulkan version only if 1.0. 2020-04-02 19:40:44 -04:00
Bill Hollings
98fadbf68b Fix memory estimates for iOS 13+.
Fix os_proc_available_memory() not being called.
2020-04-02 18:54:22 -04:00
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
df11916217
Merge pull request #850 from billhollings/master
Support screen captures.
2020-04-02 13:41:50 -04:00
Bill Hollings
2037b6c007 Defer resetting MTLTexture in MVKSwapchainImage until request to acquire.
Move call to MVKSwapchainImage::resetMetalDrawable() from immediately after
presentation until request to acquire, to preserve image content for copying
after presentation in cases such as an app screen capture operation.

Testing indicates this deferral has little or no adverse effect on the performance
of retrieving the drawable when next needed.
2020-04-02 12:54:57 -04:00
Bill Hollings
fde9d515ca Remove secondary MVKSwapchainImage constructor. 2020-04-02 11:35:26 -04:00
Bill Hollings
6229582887 Move tracking of swapchain image availability from MVKSwapchain to MVKSwapchainImage. 2020-04-02 10:57:06 -04:00
Bill Hollings
68b5f72d86 Move tracking of CAMetalDrawable from MVKSwapchain to MVKSwapchainImage. 2020-04-01 21:33:29 -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
453fbb4045 MVKImage fixes for texture view creation.
Fix potential deadlock when getMTLTexture(MTLPixelFormat) calls getMTLTexture().
Clear texture views when base texture is removed.
2020-03-31 13:25:20 -04:00
Bill Hollings
d5c62cc55a Reorganize code in MVKImage.h/mm to move MVKSwapchainImage closer to MVKImage. 2020-03-30 19:35:01 -04:00
Bill Hollings
d256991a7a
Merge pull request #845 from billhollings/master
Do not create depth/stencil MTLTextures from MTLHeap.
2020-03-30 16:20:20 -04:00
Bill Hollings
b882161519 Do not create depth/stencil MTLTextures from MTLHeap.
See GitHub issues 792 & 832. Depth/stencil textures issued from MTLHeap can be flaky in
some situations, including depth-only rendering on Intel GPUs, and corruption when DS
texture with sampling usage is combined with non-DS texture on a single placement heap.
2020-03-30 15:39:34 -04:00
Bill Hollings
a0e3ab59f4 MVKPhysicalDevice add macros to simplify testing MTLFeatureSet and MTLGPUFamily.
Remove MVKPhysicalDevice::getSupportsGPUFamily();
2020-03-30 14:17:49 -04:00
Bill Hollings
8ec5f93802 MVKInstance instantiate MVKPhysicalDevices in-place instead of using new. 2020-03-30 13:13:54 -04:00
Bill Hollings
fee050372b Move derivation of MTLTextureUsage to MVKPixelFormats.
Add MVKPixelFormats::getMTLTextureUsageFromVkImageUsageFlags(), which takes
into account limitations of pixel formats.
MVKImage remove getMTLTextureUsage(), getSupportsAnyFormatFeature()
and getSupportsAllFormatFeatures().
MVKPixelFormats tracks MVKPhysicalDevice, not just MVKVulkanAPIObject.
MVKPixelFormats refactor constructors and internal retrieval of MTLDevice.
Add MTLPixelFormat to mvkMTLTextureUsageFromVkImageUsageFlags() params for compatibility.
Remove optionality of hasResolveAttachment param in
mvkMTLStoreActionFromVkAttachmentStoreOp() to support C calling.
2020-03-30 12:45:18 -04:00
Bill Hollings
5728f50f0f Add mvkOSVersionIsAtLeast() to simplify and standardizing testing OS version. 2020-03-28 20:11:21 -04:00
Bill Hollings
d04dc46e79
Merge pull request #844 from billhollings/master
Update to latest SPIRV-Cross and Vulkan-Headers and fixes to pipeline cache loading.
2020-03-26 20:42:05 -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
c0c9a66caf
Merge pull request #843 from billhollings/master
Accurately populate Vulkan VkFormatProperties and capabilities.
2020-03-26 16:45:04 -04:00
Bill Hollings
3fa95d4c06 Refactor MVKImageView use without MVKDevice for testing formats.
Replace MVKImageView::getSwizzledMTLPixelFormat() with static validateSwizzledMTLPixelFormat()
to support querying format support without having to create fake MVKImageView instance from
MVKPhysicalDevice::getImageViewIsSupported().
Remove ability for MVKDeviceTrackingMixin and subclasses to work without a MVKDevice.
Remove mvkPlatformPixelFormats().
2020-03-26 14:40:08 -04:00