From 103f164cb3292d3ffd2607c9cb106793bae1ad16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 14 Nov 2020 20:32:16 +0100 Subject: [PATCH] Vk: print device name on creation. --- src/Magnum/Vk/Device.cpp | 1 + src/Magnum/Vk/Test/DeviceVkTest.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Magnum/Vk/Device.cpp b/src/Magnum/Vk/Device.cpp index b809db08e..ff5dfbb4a 100644 --- a/src/Magnum/Vk/Device.cpp +++ b/src/Magnum/Vk/Device.cpp @@ -321,6 +321,7 @@ Device::Device(Instance& instance, const DeviceCreateInfo& info, DevicePropertie /* Print all enabled extensions if we're not told to be quiet */ if(!info._state || !info._state->quietLog) { + Debug{} << "Device:" << _properties->name(); Debug{} << "Device version:" << version; if(info->enabledExtensionCount) { diff --git a/src/Magnum/Vk/Test/DeviceVkTest.cpp b/src/Magnum/Vk/Test/DeviceVkTest.cpp index 5e8481cf8..b6c8d43ba 100644 --- a/src/Magnum/Vk/Test/DeviceVkTest.cpp +++ b/src/Magnum/Vk/Test/DeviceVkTest.cpp @@ -91,6 +91,7 @@ struct { Containers::array({"", "--magnum-enable-extensions", "VK_EXT_debug_marker VK_KHR_maintenance1"}), true, true, true, + "Device: {}\n" "Device version: Vulkan {}.{}{}\n" "Enabled device extensions:\n" " VK_EXT_debug_marker\n" @@ -102,6 +103,7 @@ struct { "--magnum-vulkan-version", "1.0", "--magnum-enable-extensions", "VK_EXT_debug_marker VK_KHR_maintenance1"}), false, true, true, + "Device: {}\n" "Device version: Vulkan 1.0\n" "Enabled device extensions:\n" " VK_EXT_debug_marker\n" @@ -112,6 +114,7 @@ struct { Containers::array({"", "--magnum-enable-extensions", "VK_KHR_maintenance1"}), true, false, true, + "Device: {}\n" "Device version: Vulkan {}.{}{}\n" "Enabled device extensions:\n" " VK_KHR_maintenance1\n"}, @@ -120,6 +123,7 @@ struct { "--magnum-disable-extensions", "VK_EXT_debug_marker VK_KHR_maintenance1"}), nullptr, true, false, false, + "Device: {}\n" "Device version: Vulkan {}.{}{}\n"}, }; @@ -402,7 +406,7 @@ void DeviceVkTest::constructExtensionsCommandLineDisable() { UnsignedInt minor = versionMinor(deviceProperties.apiVersion()); UnsignedInt patch = versionPatch(deviceProperties.apiVersion()); /* SwiftShader reports just 1.1 with no patch version, special-case that */ - CORRADE_COMPARE(out.str(), Utility::formatString(data.log, major, minor, patch ? Utility::formatString(".{}", patch) : "")); + CORRADE_COMPARE(out.str(), Utility::formatString(data.log, deviceProperties.name(), major, minor, patch ? Utility::formatString(".{}", patch) : "")); /* Verify that the entrypoint is actually (not) loaded as expected, to avoid all the above reporting being just smoke & mirrors */ @@ -456,7 +460,7 @@ void DeviceVkTest::constructExtensionsCommandLineEnable() { UnsignedInt minor = versionMinor(deviceProperties.apiVersion()); UnsignedInt patch = versionPatch(deviceProperties.apiVersion()); /* SwiftShader reports just 1.1 with no patch version, special-case that */ - CORRADE_COMPARE(out.str(), Utility::formatString(data.log, major, minor, patch ? Utility::formatString(".{}", patch) : "")); + CORRADE_COMPARE(out.str(), Utility::formatString(data.log, deviceProperties.name(), major, minor, patch ? Utility::formatString(".{}", patch) : "")); /* Verify that the entrypoint is actually (not) loaded as expected, to avoid all the above reporting being just smoke & mirrors */