radv: Add support for VK_KHR_driver_properties.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 30 Sep 2018 18:02:04 +0000 (20:02 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Thu, 25 Oct 2018 14:14:43 +0000 (16:14 +0200)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_extensions.py

index cf1132098d26f455db56335c6e27e069b6e54c7a..8e43a3aab58620dfc756387c068dd8e8dd8a89d2 100644 (file)
@@ -43,6 +43,7 @@
 #include "ac_llvm_util.h"
 #include "vk_format.h"
 #include "sid.h"
+#include "git_sha1.h"
 #include "gfx9d.h"
 #include "addrlib/gfx9/chip/gfx9_enum.h"
 #include "util/build_id.h"
@@ -1207,6 +1208,29 @@ void radv_GetPhysicalDeviceProperties2(
                        properties->pciFunction = pdevice->bus_info.func;
                        break;
                }
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR: {
+                       VkPhysicalDeviceDriverPropertiesKHR *driver_props =
+                               (VkPhysicalDeviceDriverPropertiesKHR *) ext;
+
+                       driver_props->driverID = VK_DRIVER_ID_MESA_RADV_KHR;
+                       memset(driver_props->driverName, 0, VK_MAX_DRIVER_NAME_SIZE_KHR);
+                       strcpy(driver_props->driverName, "radv");
+
+                       memset(driver_props->driverInfo, 0, VK_MAX_DRIVER_INFO_SIZE_KHR);
+                       snprintf(driver_props->driverInfo, VK_MAX_DRIVER_INFO_SIZE_KHR,
+                               "Mesa " PACKAGE_VERSION " (" MESA_GIT_SHA1 ")"
+                               " (LLVM %d.%d.%d)",
+                                (HAVE_LLVM >> 8) & 0xff, HAVE_LLVM & 0xff,
+                                MESA_LLVM_VERSION_PATCH);
+
+                       driver_props->conformanceVersion = (VkConformanceVersionKHR) {
+                               .major = 1,
+                               .minor = 1,
+                               .subminor = 2,
+                               .patch = 0,
+                       };
+                       break;
+               }
                default:
                        break;
                }
index 125ba83105557d96606786a402eacfca896ede05..0024bf0efe1581816355e639911b7f9e82f2e6b4 100644 (file)
@@ -59,6 +59,7 @@ EXTENSIONS = [
     Extension('VK_KHR_device_group',                      1, True),
     Extension('VK_KHR_device_group_creation',             1, True),
     Extension('VK_KHR_draw_indirect_count',               1, True),
+    Extension('VK_KHR_driver_properties',                 1, True),
     Extension('VK_KHR_external_fence',                    1, 'device->rad_info.has_syncobj_wait_for_submit'),
     Extension('VK_KHR_external_fence_capabilities',       1, True),
     Extension('VK_KHR_external_fence_fd',                 1, 'device->rad_info.has_syncobj_wait_for_submit'),