aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Giessen <charles@lunarg.com>2020-01-27 20:44:52 -0700
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>2020-01-28 10:33:52 -0700
commitebe1b7497acbcf05d460f03827cf3870845cd7b7 (patch)
tree912318161276129e99bd6037153a0673521361d3
parente39b5cf6a1b674cd4ff354ca60c6019874a6b15b (diff)
downloadusermoji-ebe1b7497acbcf05d460f03827cf3870845cd7b7.tar.xz
vulkaninfo: use patch version from instance
When the original vkEnumerateInstanceVersion was implemented, the loader always return 0 for the patch. This has since been corrected, but in the mean time vulkaninfo used the hardcoded VK_HEADER_VERSION to get the patch information. Now vulkaninfo will use the patch version from the instance, unless it is zero, in which it will then fallback to VK_HEADER_VERSION's patch. Changes to be committed: modified: vulkaninfo/vulkaninfo.h Change-Id: If0a63534253afadccbad50c6256cdef8016222c1
-rw-r--r--vulkaninfo/vulkaninfo.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/vulkaninfo/vulkaninfo.h b/vulkaninfo/vulkaninfo.h
index c9a1dd0d..6ba97d98 100644
--- a/vulkaninfo/vulkaninfo.h
+++ b/vulkaninfo/vulkaninfo.h
@@ -362,7 +362,10 @@ struct AppInstance {
if (err) ERR_EXIT(err);
}
- vk_version = {VK_VERSION_MAJOR(instance_version), VK_VERSION_MINOR(instance_version), VK_VERSION_PATCH(VK_HEADER_VERSION)};
+ // fallback to baked header version if loader returns 0 for the patch version
+ uint32_t patch_version = VK_VERSION_PATCH(instance_version);
+ if (patch_version == 0) patch_version = VK_VERSION_PATCH(VK_HEADER_VERSION);
+ vk_version = {VK_VERSION_MAJOR(instance_version), VK_VERSION_MINOR(instance_version), patch_version};
AppGetInstanceExtensions();