| Index: src/gpu/vk/GrVkExtensions.cpp
|
| diff --git a/src/gpu/vk/GrVkExtensions.cpp b/src/gpu/vk/GrVkExtensions.cpp
|
| index c1ca2dd3a21e32c4d5c537188be86de7d8e93872..03b453090fdf1ade29c7c303ee7f039ce0431546 100644
|
| --- a/src/gpu/vk/GrVkExtensions.cpp
|
| +++ b/src/gpu/vk/GrVkExtensions.cpp
|
| @@ -32,7 +32,12 @@ static int find_string(const SkTArray<SkString>& 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);
|
|
|