mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-13 11:27:42 +01:00
Add GPU Info to Crash Handler
I'm sure there's a better way to do this, but I also shouldn't be allowed to touch any cpp code. This loops through all dxgi adapters based on example code I ripped from Microsoft and StackOverflow and dumps that into the crash log. I'm hoping it doesn't make the window too tall, so if there's a better way to list only the display adapters that are unique, I'm all for it.
This commit is contained in:
parent
2b347eaff9
commit
73447f205d
1 changed files with 55 additions and 0 deletions
|
|
@ -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,37 @@ void open_folder_and_select_items(HWND hwndOpener, const std::wstring& path) {
|
|||
ILFree(piid);
|
||||
}
|
||||
|
||||
std::vector <IDXGIAdapter1*> EnumerateAdapters(void)
|
||||
{
|
||||
IDXGIAdapter1* pAdapter;
|
||||
std::vector <IDXGIAdapter1*> vAdapters;
|
||||
IDXGIFactory1* pFactory = NULL;
|
||||
|
||||
|
||||
// Create a DXGIFactory object.
|
||||
if (FAILED(CreateDXGIFactory1(__uuidof(IDXGIFactory1), (void**)&pFactory)))
|
||||
{
|
||||
return vAdapters;
|
||||
}
|
||||
|
||||
|
||||
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
|
||||
|
|
@ -1022,6 +1056,27 @@ 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;
|
||||
|
||||
std::vector <IDXGIAdapter1*> availableAdapters = EnumerateAdapters();
|
||||
|
||||
for (int i = 0; i < availableAdapters.size(); i++) {
|
||||
auto& myAdapter = *availableAdapters[i];
|
||||
auto adapterDescription = DXGI_ADAPTER_DESC1();
|
||||
myAdapter.GetDesc1(&adapterDescription);
|
||||
// Print description to console here
|
||||
log << std::format(L"GPU Desc: {}", adapterDescription.Description) << std::endl;
|
||||
}
|
||||
|
||||
/*
|
||||
for_each(availableAdapters.begin(), availableAdapters.end(), [](IDXGIAdapter1* adapter, , std::wostream log) {
|
||||
auto& myAdapter = *adapter;
|
||||
auto adapterDescription = DXGI_ADAPTER_DESC1();
|
||||
myAdapter.GetDesc1(&adapterDescription);
|
||||
// Print description to console here
|
||||
log << std::format(L"GPU Desc: {}", adapterDescription.Description) << std::endl;
|
||||
});
|
||||
*/
|
||||
|
||||
log << L"\n" << stackTrace << std::endl;
|
||||
|
||||
if (pProgressDialog)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue