Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(476)

Unified Diff: src/gpu/vk/GrVkExtensions.cpp

Issue 1970233002: Ignore patch version when checking compatibility of vulkan layers (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: extension Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698