From f3a224a1f19e9d67cb683a965d1fb88636eabf6c Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 29 Mar 2018 18:47:48 -0700 Subject: Implemented hardware adapter and display mode enumeration --- .../interface/RenderDeviceFactoryD3D12.h | 9 +++++++++ .../GraphicsEngineD3D12/src/RenderDeviceFactoryD3D12.cpp | 15 +++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) (limited to 'Graphics/GraphicsEngineD3D12') diff --git a/Graphics/GraphicsEngineD3D12/interface/RenderDeviceFactoryD3D12.h b/Graphics/GraphicsEngineD3D12/interface/RenderDeviceFactoryD3D12.h index bdc3d8a0..6a8c7e6e 100644 --- a/Graphics/GraphicsEngineD3D12/interface/RenderDeviceFactoryD3D12.h +++ b/Graphics/GraphicsEngineD3D12/interface/RenderDeviceFactoryD3D12.h @@ -60,6 +60,15 @@ public: void* pNativeWndHandle, ISwapChain **ppSwapChain ) = 0; + virtual void EnumerateHardwareAdapters(Uint32 &NumAdapters, + HardwareAdapterAttribs *Adapters) = 0; + + virtual void EnumerateDisplayModes(Uint32 AdapterId, + Uint32 OutputId, + TEXTURE_FORMAT Format, + Uint32 &NumDisplayModes, + DisplayModeAttribs *DisplayModes) = 0; + }; diff --git a/Graphics/GraphicsEngineD3D12/src/RenderDeviceFactoryD3D12.cpp b/Graphics/GraphicsEngineD3D12/src/RenderDeviceFactoryD3D12.cpp index 8c62382b..8e41f986 100644 --- a/Graphics/GraphicsEngineD3D12/src/RenderDeviceFactoryD3D12.cpp +++ b/Graphics/GraphicsEngineD3D12/src/RenderDeviceFactoryD3D12.cpp @@ -30,6 +30,7 @@ #include "DeviceContextD3D12Impl.h" #include "SwapChainD3D12Impl.h" #include "D3D12TypeConversions.h" +#include "EngineFactoryD3DBase.h" #include "StringTools.h" #include "EngineMemory.h" #include "CommandQueueD3D12Impl.h" @@ -40,7 +41,7 @@ namespace Diligent { /// Engine factory for D3D12 implementation -class EngineFactoryD3D12Impl : public IEngineFactoryD3D12 +class EngineFactoryD3D12Impl : public EngineFactoryD3DBase { public: static EngineFactoryD3D12Impl* GetInstance() @@ -62,11 +63,10 @@ public: Uint32 NumDeferredContexts)override final; void CreateSwapChainD3D12( IRenderDevice *pDevice, - IDeviceContext *pImmediateContext, - const SwapChainDesc& SwapChainDesc, - void* pNativeWndHandle, - ISwapChain **ppSwapChain )override final; - + IDeviceContext *pImmediateContext, + const SwapChainDesc& SwapChainDesc, + void* pNativeWndHandle, + ISwapChain **ppSwapChain )override final; }; void GetHardwareAdapter(IDXGIFactory2* pFactory, IDXGIAdapter1** ppAdapter) @@ -81,8 +81,7 @@ void GetHardwareAdapter(IDXGIFactory2* pFactory, IDXGIAdapter1** ppAdapter) if (desc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE) { - // Don't select the Basic Render Driver adapter. - // If you want a software adapter, pass in "/warp" on the command line. + // Skip software devices continue; } -- cgit v1.2.3