From: egdaniel Date: Thu, 12 May 2016 18:42:00 +0000 (-0700) Subject: Ignore patch version when checking compatibility of vulkan layers X-Git-Tag: submit/tizen/20180928.044319~129^2~531 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dde2c0356c33d488fecfb455403e1de5057914ee;p=platform%2Fupstream%2FlibSkiaSharp.git Ignore patch version when checking compatibility of vulkan layers BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1970233002 Review-Url: https://codereview.chromium.org/1970233002 --- diff --git a/src/gpu/vk/GrVkExtensions.cpp b/src/gpu/vk/GrVkExtensions.cpp index c1ca2dd3a2..03b453090f 100644 --- a/src/gpu/vk/GrVkExtensions.cpp +++ b/src/gpu/vk/GrVkExtensions.cpp @@ -32,7 +32,12 @@ static int find_string(const SkTArray& strings, const char ext[]) { #define GET_PROC_LOCAL(inst, F) PFN_vk ## F F = (PFN_vk ## F) vkGetInstanceProcAddr(inst, "vk" #F) +static uint32_t remove_patch_version(uint32_t specVersion) { + return (specVersion >> 12) << 12; +} + bool GrVkExtensions::initInstance(uint32_t specVersion) { + uint32_t nonPatchVersion = remove_patch_version(specVersion); GET_PROC_LOCAL(nullptr, EnumerateInstanceExtensionProperties); GET_PROC_LOCAL(nullptr, EnumerateInstanceLayerProperties); @@ -57,7 +62,7 @@ bool GrVkExtensions::initInstance(uint32_t specVersion) { return false; } for (uint32_t i = 0; i < layerCount; ++i) { - if (specVersion >= layers[i].specVersion) { + if (nonPatchVersion >= remove_patch_version(layers[i].specVersion)) { fInstanceLayerStrings->push_back() = layers[i].layerName; } } @@ -80,7 +85,7 @@ bool GrVkExtensions::initInstance(uint32_t specVersion) { return false; } for (uint32_t i = 0; i < extensionCount; ++i) { - if (specVersion >= extensions[i].specVersion) { + if (nonPatchVersion >= remove_patch_version(extensions[i].specVersion)) { fInstanceExtensionStrings->push_back() = extensions[i].extensionName; } } @@ -107,7 +112,7 @@ bool GrVkExtensions::initInstance(uint32_t specVersion) { } for (uint32_t i = 0; i < extensionCount; ++i) { // if not already in the list, add it - if (specVersion >= extensions[i].specVersion && + if (nonPatchVersion >= remove_patch_version(extensions[i].specVersion) && find_string(*fInstanceExtensionStrings, extensions[i].extensionName) < 0) { fInstanceExtensionStrings->push_back() = extensions[i].extensionName; SkTQSort(&fInstanceExtensionStrings->front(), &fInstanceExtensionStrings->back(), @@ -121,6 +126,7 @@ bool GrVkExtensions::initInstance(uint32_t specVersion) { } bool GrVkExtensions::initDevice(uint32_t specVersion, VkInstance inst, VkPhysicalDevice physDev) { + uint32_t nonPatchVersion = remove_patch_version(specVersion); GET_PROC_LOCAL(inst, EnumerateDeviceExtensionProperties); GET_PROC_LOCAL(inst, EnumerateDeviceLayerProperties); @@ -145,7 +151,7 @@ bool GrVkExtensions::initDevice(uint32_t specVersion, VkInstance inst, VkPhysica return false; } for (uint32_t i = 0; i < layerCount; ++i) { - if (specVersion >= layers[i].specVersion) { + if (nonPatchVersion >= remove_patch_version(layers[i].specVersion)) { fDeviceLayerStrings->push_back() = layers[i].layerName; } } @@ -169,7 +175,7 @@ bool GrVkExtensions::initDevice(uint32_t specVersion, VkInstance inst, VkPhysica return false; } for (uint32_t i = 0; i < extensionCount; ++i) { - if (specVersion >= extensions[i].specVersion) { + if (nonPatchVersion >= remove_patch_version(extensions[i].specVersion)) { fDeviceExtensionStrings->push_back() = extensions[i].extensionName; } } @@ -198,7 +204,7 @@ bool GrVkExtensions::initDevice(uint32_t specVersion, VkInstance inst, VkPhysica } for (uint32_t i = 0; i < extensionCount; ++i) { // if not already in the list, add it - if (specVersion >= extensions[i].specVersion && + if (nonPatchVersion >= remove_patch_version(extensions[i].specVersion) && find_string(*fDeviceExtensionStrings, extensions[i].extensionName) < 0) { fDeviceExtensionStrings->push_back() = extensions[i].extensionName; SkTQSort(&fDeviceExtensionStrings->front(), &fDeviceExtensionStrings->back(), cmp);