From 9d40ec2cf6ec6d3d9d78deead9f334523843fa48 Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Sun, 30 Sep 2018 20:02:04 +0200 Subject: [PATCH] radv: Add support for VK_KHR_driver_properties. Reviewed-by: Jason Ekstrand --- src/amd/vulkan/radv_device.c | 24 ++++++++++++++++++++++++ src/amd/vulkan/radv_extensions.py | 1 + 2 files changed, 25 insertions(+) diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index cf1132098d2..8e43a3aab58 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -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; } diff --git a/src/amd/vulkan/radv_extensions.py b/src/amd/vulkan/radv_extensions.py index 125ba831055..0024bf0efe1 100644 --- a/src/amd/vulkan/radv_extensions.py +++ b/src/amd/vulkan/radv_extensions.py @@ -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'), -- 2.30.2