#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);
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;
}
}
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;
}
}
}
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(),
}
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);
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;
}
}
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;
}
}
}
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);