aboutsummaryrefslogtreecommitdiff
path: root/cube/cube.c
diff options
context:
space:
mode:
authorJeremy Hayes <jeremy@lunarg.com>2022-02-09 15:04:42 -0700
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>2022-02-09 16:41:44 -0700
commit5f9e5f14e572a6c9f7ff4d54e2fd4d82632bc393 (patch)
tree0cc17cbff024cf124b1fb13cef95cd70100a25dc /cube/cube.c
parent48f36ffd590bbbd57485600396f71bf3ddba8109 (diff)
downloadusermoji-5f9e5f14e572a6c9f7ff4d54e2fd4d82632bc393.tar.xz
Make device selection output constistent
Make vkcube print a string for device type, which is consistent with vkcubepp.
Diffstat (limited to 'cube/cube.c')
-rw-r--r--cube/cube.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/cube/cube.c b/cube/cube.c
index 6bf8f4ac..e0d8a31a 100644
--- a/cube/cube.c
+++ b/cube/cube.c
@@ -292,6 +292,19 @@ void dumpVec4(const char *note, vec4 vector) {
fflush(stdout);
}
+char const* to_string(VkPhysicalDeviceType const type)
+{
+ switch(type)
+ {
+ case VK_PHYSICAL_DEVICE_TYPE_OTHER: return "Other";
+ case VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU: return "IntegratedGpu";
+ case VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU: return "DiscreteGpu";
+ case VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU: return "VirtualGpu";
+ case VK_PHYSICAL_DEVICE_TYPE_CPU: return "Cpu";
+ default: return "Unknown";
+ }
+}
+
typedef struct {
VkImage image;
VkCommandBuffer cmd;
@@ -3419,8 +3432,8 @@ static void demo_init_vk(struct demo *demo) {
{
VkPhysicalDeviceProperties physicalDeviceProperties;
vkGetPhysicalDeviceProperties(demo->gpu, &physicalDeviceProperties);
- fprintf(stderr, "Selected GPU %d: %s, type: %u\n", demo->gpu_number, physicalDeviceProperties.deviceName,
- physicalDeviceProperties.deviceType);
+ fprintf(stderr, "Selected GPU %d: %s, type: %s\n", demo->gpu_number, physicalDeviceProperties.deviceName,
+ to_string(physicalDeviceProperties.deviceType));
}
free(physical_devices);