From e8d4cd032a88197d807b9290f28639b3ceb17d1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sat, 10 Aug 2019 10:57:22 -0700 Subject: [PATCH] VK: Added device info to debug screen. --- src/renderer_vk.cpp | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/renderer_vk.cpp b/src/renderer_vk.cpp index 3ea4767d3..7e9330240 100644 --- a/src/renderer_vk.cpp +++ b/src/renderer_vk.cpp @@ -392,6 +392,22 @@ VK_IMPORT_DEVICE _vertexInputState.vertexAttributeDescriptionCount = numAttribs; } + static const char* s_deviceTypeName[] = + { + "Other", + "Integrated GPU", + "Discrete GPU", + "Virtual GPU", + "CPU", + + "Unknown?!" + }; + + const char* getName(VkPhysicalDeviceType _type) + { + return s_deviceTypeName[bx::min(_type, BX_COUNTOF(s_deviceTypeName) )]; + } + static const char* s_allocScopeName[] = { "vkCommand", @@ -975,7 +991,6 @@ VK_IMPORT } } - VkInstanceCreateInfo ici; ici.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; ici.pNext = NULL; @@ -6136,10 +6151,11 @@ BX_UNUSED(presentMin, presentMax); , getRendererName() ); -// const DXGI_ADAPTER_DESC& desc = m_adapterDesc; -// char description[BX_COUNTOF(desc.Description)]; -// wcstombs(description, desc.Description, BX_COUNTOF(desc.Description) ); -// tvm.printf(0, pos++, 0x8f, " Device: %s", description); + const VkPhysicalDeviceProperties& pdp = m_deviceProperties; + tvm.printf(0, pos++, 0x8f, " Device: %s (%s)" + , pdp.deviceName + , getName(pdp.deviceType) + ); // // char dedicatedVideo[16]; // bx::prettify(dedicatedVideo, BX_COUNTOF(dedicatedVideo), desc.DedicatedVideoMemory);