radv: consider MESA_VK_VERSION_OVERRIDE when setting the api version
authorEleni Maria Stea <estea@igalia.com>
Mon, 29 Apr 2019 07:00:17 +0000 (09:00 +0200)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Mon, 29 Apr 2019 07:00:51 +0000 (09:00 +0200)
Before setting the physical device API version, we should check if the
MESA_VK_VERSION_OVERRIDE environment variable is set and take it into
account.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/amd/vulkan/radv_extensions.py

index d56d64b2dcba46111c2a061850003e79001795ba..23e76bfcc11c37363536d23b8ae86d5f77f65340 100644 (file)
@@ -335,9 +335,12 @@ VkResult radv_EnumerateInstanceVersion(
 uint32_t
 radv_physical_device_api_version(struct radv_physical_device *dev)
 {
+    uint32_t override = vk_get_version_override();
+    uint32_t version = VK_MAKE_VERSION(1, 0, 68);
     if (dev->rad_info.has_syncobj_wait_for_submit)
-        return ${MAX_API_VERSION.c_vk_version()};
-    return VK_MAKE_VERSION(1, 0, 68);
+        version = ${MAX_API_VERSION.c_vk_version()};
+
+    return override ? MIN2(override, version) : version;
 }
 """)