Merge pull request #2614 from reiichi001/add_gpu_to_crashinfo

Add GPU Info to Crash Handler
This commit is contained in:
goat 2026-02-12 22:11:25 +01:00 committed by GitHub
commit 990c4fd7e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -28,6 +28,9 @@
#include <ShObjIdl.h>
#include <shlobj_core.h>
#include <dxgi.h>
#pragma comment(lib, "dxgi.lib")
#pragma comment(lib, "comctl32.lib")
#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
@ -470,6 +473,32 @@ void open_folder_and_select_items(HWND hwndOpener, const std::wstring& path) {
ILFree(piid);
}
std::vector<IDXGIAdapter1*> enum_dxgi_adapters()
{
std::vector<IDXGIAdapter1*> vAdapters;
IDXGIFactory1* pFactory = NULL;
if (FAILED(CreateDXGIFactory1(__uuidof(IDXGIFactory1), (void**)&pFactory)))
{
return vAdapters;
}
IDXGIAdapter1* pAdapter;
for (UINT i = 0;
pFactory->EnumAdapters1(i, &pAdapter) != DXGI_ERROR_NOT_FOUND;
++i)
{
vAdapters.push_back(pAdapter);
}
if (pFactory)
{
pFactory->Release();
}
return vAdapters;
}
void export_tspack(HWND hWndParent, const std::filesystem::path& logDir, const std::string& crashLog, const std::string& troubleshootingPackData) {
static const char* SourceLogFiles[] = {
"output.log", // XIVLauncher for Windows
@ -1023,6 +1052,13 @@ int main() {
log << std::format(L"System Time: {0:%F} {0:%T} {0:%Ez}", std::chrono::system_clock::now()) << std::endl;
log << std::format(L"CPU Vendor: {}", vendor) << std::endl;
log << std::format(L"CPU Brand: {}", brand) << std::endl;
for (IDXGIAdapter1* adapter : enum_dxgi_adapters()) {
DXGI_ADAPTER_DESC1 adapterDescription{};
adapter->GetDesc1(&adapterDescription);
log << std::format(L"GPU Desc: {}", adapterDescription.Description) << std::endl;
}
log << L"\n" << stackTrace << std::endl;
if (pProgressDialog)