#include "gfx_dx12.hpp" #include #include #include #include #include // from https://stackoverflow.com/a/18374698 std::string ws2s(const std::wstring& wstr) { using convert_typeX = std::codecvt_utf8; std::wstring_convert converterX; return converterX.to_bytes(wstr); } bool gfx_dx12::initialize(const GFXCreateInfo& info) { get_device(); return true; } void gfx_dx12::get_device() { ComPtr dxgiFactory; UINT createFactoryFlags = DXGI_CREATE_FACTORY_DEBUG; CreateDXGIFactory2(createFactoryFlags, IID_PPV_ARGS(&dxgiFactory)); ComPtr adapter; for (UINT i = 0; dxgiFactory->EnumAdapters1(i, &adapter) != DXGI_ERROR_NOT_FOUND; i++) { DXGI_ADAPTER_DESC1 dxgiAdapterDesc1; adapter->GetDesc1(&dxgiAdapterDesc1); prism::log("GPU: {}", ws2s(dxgiAdapterDesc1.Description)); } } const char* gfx_dx12::get_name() { return "DX12"; }