Skip to content

Commit d8d9a9d

Browse files
Treehugger RobotAndroid (Google) Code Review
authored andcommitted
Merge "Downgrade ICD's view of VkApplicationInfo::apiVersion for 1.3 ICD" into main
2 parents 8269429 + a997215 commit d8d9a9d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

vulkan/libvulkan/driver.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,19 @@ VkResult CreateInfoWrapper::SanitizeApiVersion() {
439439
if (!is_instance_ || !instance_info_.pApplicationInfo)
440440
return VK_SUCCESS;
441441

442+
// certain 1.3 icds in the wild may misbehave if the app requests
443+
// the 1.4 instance api. since there are no actual instance api
444+
// differences between these versions, downgrade the instance api
445+
// to 1.3 for such icds.
446+
if (icd_api_version_ >= VK_API_VERSION_1_3 &&
447+
icd_api_version_ < VK_API_VERSION_1_4 &&
448+
instance_info_.pApplicationInfo->apiVersion >= VK_API_VERSION_1_4) {
449+
application_info_ = *instance_info_.pApplicationInfo;
450+
application_info_.apiVersion = icd_api_version_;
451+
instance_info_.pApplicationInfo = &application_info_;
452+
return VK_SUCCESS;
453+
}
454+
442455
if (icd_api_version_ > VK_API_VERSION_1_0 ||
443456
instance_info_.pApplicationInfo->apiVersion < VK_API_VERSION_1_1)
444457
return VK_SUCCESS;

0 commit comments

Comments
 (0)