Skip to content

Commit

Permalink
Add driver version reporting (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
solidpixel authored Jan 30, 2025
1 parent 0f2575a commit 4290572
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions layer_gpu_timeline/source/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <array>
#include <iostream>
#include <fstream>
#include <nlohmann/json.hpp>
#include <sys/stat.h>
#include <vector>

Expand All @@ -35,6 +36,8 @@
#include "device.hpp"
#include "instance.hpp"

using json = nlohmann::json;

/**
* @brief The dispatch lookup for all of the created Vulkan devices.
*/
Expand Down Expand Up @@ -114,4 +117,25 @@ Device::Device(
commsModule = std::make_unique<Comms::CommsModule>("lglcomms");
commsWrapper = std::make_unique<TimelineComms>(*commsModule);
}

// Determine the driver version and emit the preamble message
VkPhysicalDeviceProperties deviceProperties;
instance->driver.vkGetPhysicalDeviceProperties(physicalDevice, &deviceProperties);

std::string name { deviceProperties.deviceName };

uint32_t driverVersion = deviceProperties.driverVersion;
uint32_t major = VK_VERSION_MAJOR(driverVersion);
uint32_t minor = VK_VERSION_MINOR(driverVersion);
uint32_t patch = VK_VERSION_PATCH(driverVersion);

json deviceMetadata {
{ "type", "device" },
{ "deviceName", name },
{ "driverMajor", major },
{ "driverMinor", minor },
{ "driverPatch", patch }
};

commsWrapper->txMessage(deviceMetadata.dump());
}

0 comments on commit 4290572

Please sign in to comment.