diff --git a/ExternalRevisions/VulkanSamples_repo_revision b/ExternalRevisions/VulkanSamples_repo_revision index 909b4a8a..0facaac9 100644 --- a/ExternalRevisions/VulkanSamples_repo_revision +++ b/ExternalRevisions/VulkanSamples_repo_revision @@ -1 +1 @@ -2c05813aff7161f04250673e690e6c130cfae2d7 +4d56b6cb5ce0682bd3ade4bb20791c7bc16c3ce8 diff --git a/MoltenVK/MoltenVK/API/vk_mvk_moltenvk.h b/MoltenVK/MoltenVK/API/vk_mvk_moltenvk.h index 7eea74c0..d9a8bc9e 100644 --- a/MoltenVK/MoltenVK/API/vk_mvk_moltenvk.h +++ b/MoltenVK/MoltenVK/API/vk_mvk_moltenvk.h @@ -48,7 +48,7 @@ extern "C" { */ #define MVK_VERSION_MAJOR 1 #define MVK_VERSION_MINOR 0 -#define MVK_VERSION_PATCH 2 +#define MVK_VERSION_PATCH 3 #define MVK_MAKE_VERSION(major, minor, patch) (((major) * 10000) + ((minor) * 100) + (patch)) #define MVK_VERSION MVK_MAKE_VERSION(MVK_VERSION_MAJOR, MVK_VERSION_MINOR, MVK_VERSION_PATCH) diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm index 9109dc13..6dd5139d 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm +++ b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm @@ -229,12 +229,16 @@ VkResult MVKPhysicalDevice::getSurfacePresentModes(MVKSurface* surface, CAMetalLayer* mtlLayer = surface->getCAMetalLayer(); if ( !mtlLayer ) { return surface->getConfigurationResult(); } - // TODO: check which mode(s) are applicable to Metal - const VkPresentModeKHR presentModes[] = { -// VK_PRESENT_MODE_MAILBOX_KHR, - VK_PRESENT_MODE_FIFO_KHR, - }; - const uint presentModesCnt = sizeof(presentModes) / sizeof(VkPresentModeKHR); + vector presentModes; + presentModes.push_back(VK_PRESENT_MODE_FIFO_KHR); + +#if MVK_MACOS + if ( [_mtlDevice supportsFeatureSet: MTLFeatureSet_macOS_GPUFamily1_v3] ) { + presentModes.push_back(VK_PRESENT_MODE_IMMEDIATE_KHR); + } +#endif + + uint32_t presentModesCnt = uint32_t(presentModes.size()); // If properties aren't actually being requested yet, simply update the returned count if ( !pPresentModes ) { @@ -947,9 +951,9 @@ void MVKPhysicalDevice::logGPUInfo() { #endif #if MVK_MACOS - if ( [_mtlDevice supportsFeatureSet: MTLFeatureSet_macOS_GPUFamily1_v3] ) { fsMsg += "\n\t\tOSX GPU Family 1 v3"; } - if ( [_mtlDevice supportsFeatureSet: MTLFeatureSet_macOS_GPUFamily1_v2] ) { fsMsg += "\n\t\tOSX GPU Family 1 v2"; } - if ( [_mtlDevice supportsFeatureSet: MTLFeatureSet_macOS_GPUFamily1_v1] ) { fsMsg += "\n\t\tOSX GPU Family 1 v1"; } + if ( [_mtlDevice supportsFeatureSet: MTLFeatureSet_macOS_GPUFamily1_v3] ) { fsMsg += "\n\t\tmacOS GPU Family 1 v3"; } + if ( [_mtlDevice supportsFeatureSet: MTLFeatureSet_macOS_GPUFamily1_v2] ) { fsMsg += "\n\t\tmacOS GPU Family 1 v2"; } + if ( [_mtlDevice supportsFeatureSet: MTLFeatureSet_macOS_GPUFamily1_v1] ) { fsMsg += "\n\t\tmacOS GPU Family 1 v1"; } #endif MVKLogInfo(fsMsg.c_str(), _properties.deviceName, devTypeStr.c_str(), _properties.vendorID, _properties.deviceID, diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKSwapchain.mm b/MoltenVK/MoltenVK/GPUObjects/MVKSwapchain.mm index 3a87f1ff..c491966c 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKSwapchain.mm +++ b/MoltenVK/MoltenVK/GPUObjects/MVKSwapchain.mm @@ -189,9 +189,15 @@ MVKSwapchain::MVKSwapchain(MVKDevice* device, VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT)); +#if MVK_MACOS + if ( pCreateInfo->presentMode == VK_PRESENT_MODE_IMMEDIATE_KHR) { + _mtlLayer.displaySyncEnabled = NO; + } +#endif // TODO: set additional CAMetalLayer properties before extracting drawables: // - presentsWithTransaction + // - maximumDrawableCount (maybe for MAILBOX?) // - drawsAsynchronously // - colorspace (macOS only) Vulkan only supports sRGB colorspace for now. // - wantsExtendedDynamicRangeContent (macOS only) diff --git a/fetchDependencies b/fetchDependencies index 5dd67e8f..2c33545a 100755 --- a/fetchDependencies +++ b/fetchDependencies @@ -113,7 +113,7 @@ update_repo ${REPO_NAME} ${REPO_URL} ${REPO_REV} # ----------------- VulkanSamples ------------------- REPO_NAME=VulkanSamples -REPO_URL="https://github.com/brenwill/${REPO_NAME}.git" +REPO_URL="https://github.com/LunarG/${REPO_NAME}.git" REPO_REV=$(cat "../${EXT_REV_DIR}/${REPO_NAME}_repo_revision") update_repo ${REPO_NAME} ${REPO_URL} ${REPO_REV}