Skip to content

Commit

Permalink
vk: profiler: add device/driver info
Browse files Browse the repository at this point in the history
  • Loading branch information
w23 committed Apr 10, 2023
1 parent c917c7a commit 4f4c5d3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
13 changes: 12 additions & 1 deletion ref/vk/r_speeds.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,8 +659,19 @@ void R_SpeedsDisplayMore(uint32_t prev_frame_index, const struct vk_combuf_scope

const uint32_t speeds_bits = r_speeds->value;

if (speeds_bits)
if (speeds_bits) {
speedsPrintf( "Renderer: ^1Vulkan%s^7\n", vk_frame.rtx_enabled ? " RT" : "" );
int color_index = 7; // default color
switch (vk_core.physical_device.properties.vendorID) {
case 0x1002: /* AMD */ color_index = 1; break;
case 0x10DE: /* NVIDIA */ color_index = 2; break;
case 0x8086: /* INTEL */ color_index = 4; break;
}
speedsPrintf( "^%d%s^7\n", color_index, vk_core.physical_device.properties.deviceName);
speedsPrintf( "Driver: %u.%u.%u, Vulkan: %u.%u.%u\n",
XVK_PARSE_VERSION(vk_core.physical_device.properties.driverVersion),
XVK_PARSE_VERSION(vk_core.physical_device.properties.apiVersion));
}

const uint32_t events = g_aprof.events_last_frame - prev_frame_index;
const uint64_t frame_begin_time = APROF_EVENT_TIMESTAMP(g_aprof.events[prev_frame_index]);
Expand Down
5 changes: 0 additions & 5 deletions ref/vk/vk_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@
#include <string.h>
#include <errno.h>

#define XVK_PARSE_VERSION(v) \
VK_VERSION_MAJOR(v), \
VK_VERSION_MINOR(v), \
VK_VERSION_PATCH(v)

#define NULLINST_FUNCS(X) \
X(vkEnumerateInstanceVersion) \
X(vkCreateInstance) \
Expand Down
5 changes: 5 additions & 0 deletions ref/vk/vk_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
#define VK_NO_PROTOTYPES
#include <vulkan/vulkan.h>

#define XVK_PARSE_VERSION(v) \
VK_VERSION_MAJOR(v), \
VK_VERSION_MINOR(v), \
VK_VERSION_PATCH(v)

qboolean R_VkInit( void );
void R_VkShutdown( void );

Expand Down

0 comments on commit 4f4c5d3

Please sign in to comment.