From 355e200a29d5fe63b7739b45a9127398bddef5ff Mon Sep 17 00:00:00 2001 From: Bill Hollings Date: Mon, 29 Jul 2019 15:52:24 -0400 Subject: [PATCH] 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. --- .../xcshareddata/xcschemes/API-Samples-macOS.xcscheme | 6 +++--- .../LunarG-VulkanSamples/Cube/macOS/DemoViewController.m | 7 ++----- Docs/Whats_New.md | 9 +++++++++ MoltenVK/MoltenVK/GPUObjects/MVKImage.mm | 6 ++++-- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Demos/LunarG-VulkanSamples/API-Samples/API-Samples.xcodeproj/xcshareddata/xcschemes/API-Samples-macOS.xcscheme b/Demos/LunarG-VulkanSamples/API-Samples/API-Samples.xcodeproj/xcshareddata/xcschemes/API-Samples-macOS.xcscheme index f3506472..12f43fac 100644 --- a/Demos/LunarG-VulkanSamples/API-Samples/API-Samples.xcodeproj/xcshareddata/xcschemes/API-Samples-macOS.xcscheme +++ b/Demos/LunarG-VulkanSamples/API-Samples/API-Samples.xcodeproj/xcshareddata/xcschemes/API-Samples-macOS.xcscheme @@ -42,9 +42,9 @@ getPhysicalDevice()->getPrivateMemoryTypes() : _device->getPhysicalDevice()->getAllMemoryTypes()); #if MVK_MACOS - // Textures must not use shared memory - mvkDisableFlag(pMemoryRequirements->memoryTypeBits, _device->getPhysicalDevice()->getHostCoherentMemoryTypes()); + // Metal on macOS does not provide native support for host-coherent memory, but Vulkan requires it for Linear images + if ( !_isLinear ) { + mvkDisableFlag(pMemoryRequirements->memoryTypeBits, _device->getPhysicalDevice()->getHostCoherentMemoryTypes()); + } #endif #if MVK_IOS // Only transient attachments may use memoryless storage