bring back vulkan gpu logging

This commit is contained in:
Miguel 2024-03-30 14:17:05 +01:00 committed by GitHub
parent f29d12bfcc
commit e48d8b502c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 36 additions and 1 deletions

View file

@ -161,6 +161,7 @@ Instance::Instance(Frontend::EmuWindow& window, u32 physical_device_index)
CreateDevice();
CreateFormatTable();
CollectToolingInfo();
CreateCustomFormatTable();
CreateAttribTable();
}
@ -641,4 +642,35 @@ void Instance::CreateAllocator() {
}
}
void Instance::CollectToolingInfo() {
if (!tooling_info) {
return;
}
const vk::StructureChain property_chain =
physical_device
.getProperties2<vk::PhysicalDeviceProperties2, vk::PhysicalDeviceDriverProperties>();
const vk::PhysicalDeviceDriverProperties driver =
property_chain.get<vk::PhysicalDeviceDriverProperties>();
driver_id = driver.driverID;
vendor_name = driver.driverName.data();
const std::string model_name{GetModelName()};
const std::string driver_version = GetDriverVersionName();
const std::string driver_name = fmt::format("{} {}", vendor_name, driver_version);
const std::string api_version = GetReadableVersion(properties.apiVersion);
const std::string extensions = fmt::format("{}", fmt::join(available_extensions, ", "));
LOG_INFO(Render_Vulkan, "VK_DRIVER: {}", driver_name);
LOG_INFO(Render_Vulkan, "VK_DEVICE: {}", model_name);
LOG_INFO(Render_Vulkan, "VK_VERSION: {}", api_version);
const auto tools = physical_device.getToolPropertiesEXT();
for (const vk::PhysicalDeviceToolProperties& tool : tools) {
const std::string_view name = tool.name;
LOG_INFO(Render_Vulkan, "Attached debugging tool: {}", name);
has_renderdoc = has_renderdoc || name == "RenderDoc";
has_nsight_graphics = has_nsight_graphics || name == "NVIDIA Nsight Graphics";
}
}
} // namespace Vulkan

View file

@ -284,6 +284,9 @@ private:
/// Creates the VMA allocator handle
void CreateAllocator();
//Collects logging gpu info
void CollectToolingInfo();
private:
std::shared_ptr<Common::DynamicLibrary> library;
@ -325,4 +328,4 @@ private:
bool has_renderdoc{};
};
} // namespace Vulkan
} // namespace Vulkan