Print out Vulkan information at startup devel/vulkan
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Wed, 14 Aug 2024 15:42:47 +0000 (16:42 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Wed, 14 Aug 2024 15:42:53 +0000 (16:42 +0100)
Change-Id: I11036b5dfb9abdb72550737a36c80f3d1e861b25

dali/graphics/vulkan/vulkan-graphics.cpp

index 636ff3c1f9538e46079125c767b07ee7b0745768..034f4baef6385c638907571b950f8ef0d25183eb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,9 @@
 // CLASS HEADER
 #include <dali/graphics/vulkan/vulkan-graphics.h>
 
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
+
 // INTERNAL INCLUDES
 #include <dali/graphics/vulkan/vk-surface-factory.h>
 #include <dali/graphics/vulkan/internal/vulkan-command-pool.h>
@@ -1541,6 +1544,20 @@ void Graphics::PreparePhysicalDevice()
   GetPhysicalDeviceProperties();
 
   GetQueueFamilyProperties();
+
+  // We want to display this information all the time, so use the LogMessage directly
+  Integration::Log::LogMessage(Integration::Log::DebugInfo,
+                               "Vulkan Information\n"
+                               "            Device Name:     %s\n"
+                               "            API Version:     %x\n"
+                               "            Vulkan Version:  %d.%d.%d\n"
+                               "            Driver Version:  %x\n",
+                               &mPhysicalDeviceProperties.deviceName[0],
+                               mPhysicalDeviceProperties.apiVersion,
+                               VK_VERSION_MAJOR(mPhysicalDeviceProperties.apiVersion),
+                               VK_VERSION_MINOR(mPhysicalDeviceProperties.apiVersion),
+                               VK_VERSION_PATCH(mPhysicalDeviceProperties.apiVersion),
+                               mPhysicalDeviceProperties.driverVersion);
 }
 
 void Graphics::GetPhysicalDeviceProperties()