diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-03-30 01:47:48 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-03-30 01:47:48 +0000 |
| commit | f3a224a1f19e9d67cb683a965d1fb88636eabf6c (patch) | |
| tree | d534df76090785f2ef70eb9634d07aa0be0f52dc /Graphics/GraphicsEngineD3D12 | |
| parent | Added shader name output when shader compilation fails (diff) | |
| download | DiligentCore-f3a224a1f19e9d67cb683a965d1fb88636eabf6c.tar.gz DiligentCore-f3a224a1f19e9d67cb683a965d1fb88636eabf6c.zip | |
Implemented hardware adapter and display mode enumeration
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
| -rw-r--r-- | Graphics/GraphicsEngineD3D12/interface/RenderDeviceFactoryD3D12.h | 9 | ||||
| -rw-r--r-- | Graphics/GraphicsEngineD3D12/src/RenderDeviceFactoryD3D12.cpp | 15 |
2 files changed, 16 insertions, 8 deletions
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<IEngineFactoryD3D12, DeviceType::D3D12> { 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; } |
