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.
This commit is contained in:
Bill Hollings 2019-07-29 15:52:24 -04:00
parent 73cbc80716
commit 355e200a29
4 changed files with 18 additions and 10 deletions

View File

@ -42,9 +42,9 @@
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
buildConfiguration = "Release"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"

View File

@ -43,11 +43,8 @@
self.view.wantsLayer = YES; // Back the view with a layer created by the makeBackingLayer method.
uint32_t argc = 2;
const char* argv[argc];
argv[0] = "cube";
argv[1] = "--use_staging";
demo_main(&demo, self.view.layer, argc, argv);
const char* arg = "cube";
demo_main(&demo, self.view.layer, 1, &arg);
CVDisplayLinkCreateWithActiveCGDisplays(&_displayLink);
CVDisplayLinkSetOutputCallback(_displayLink, &DisplayLinkCallback, &demo);

View File

@ -13,6 +13,15 @@ For best results, use a Markdown reader.*
MoltenVK 1.0.37
---------------
Released TBD
- Revert to supporting host-coherent memory for linear images on macOS.
MoltenVK 1.0.36
---------------

View File

@ -175,8 +175,10 @@ VkResult MVKImage::getMemoryRequirements(VkMemoryRequirements* pMemoryRequiremen
? _device->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