#include #include #include namespace Juliet { // TODO : Use LoadLibrary and not link to the lib. Allows failing earlier if Dx12 is not installed for some reason // + Will load the dll when needed // This will prevent us from using IID_ variables as they are defined in dxguid.lib namespace { bool CheckDriver() { HRESULT result; // ID3D12Device *device; IDXGIFactory4* factory4; IDXGIFactory6* factory6; IDXGIAdapter1* adapter; ID3D12Object* test; // Can create DXGI factory ? IDXGIFactory1* factory1 = nullptr; result = CreateDXGIFactory1(IID_IDXGIFactory1, reinterpret_cast(&factory1)); if (FAILED(result)) { Log(LogLevel::Warning, LogCategory::Graphics, "DX12: Cannot create DXGIFactory1"); return false; } // Can query the 1.4 factory ? result = IDXGIFactory1_QueryInterface(factory1, IID_IDXGIFactory4, reinterpret_cast(&factory4)); if (FAILED(result)) { IDXGIFactory1_Release(factory1); Log(LogLevel::Warning, LogCategory::Graphics, "DX12: Failed to query DXGI1.4."); return false; } IDXGIFactory4_Release(factory4); IDXGIFactory1_Release(factory1); return false; } GraphicsDevice* CreateGraphicsDevice() { return nullptr; } } // namespace // clang-format off GraphicsDeviceFactory DX12DeviceFactory = { .Name="DirectX12", .Type=RendererType::DX12, .CheckDriver = CheckDriver, .CreateGraphicsDevice = CreateGraphicsDevice }; // clang-format on } // namespace Juliet