diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2019-03-25 11:48:10 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-25 11:48:10 -0400 |
| commit | 2f4029a753f72833c30c4e6bad28c06b20540384 (patch) | |
| tree | ca771b5e00c6126351079b2df920d014e4ed6a1e /tools/gfx/d3d-util.h | |
| parent | 5bdc3ef07373be62363deb64dedd4163589430b6 (diff) | |
Adapter selection for Renderer (#923)
* * Make adapter used selectable on the command line
* Added 'adapter' to Renderer::Desc with dx11, dx12, vk honoring it
* GL will check that the renderer matches, but cannot select a specific device
* Share functionality on dx adapter selection in D3DUtil
Note - that on tests that use OpenGL and the adapter doesn't match it will ignore the test (and display a message that the appropriate device couldn't be started)
* Small function name improvement.
* Variable rename to match type.
* Fix typo in Dx12 device selection.
* * Add checking if an adapter is warp
* Improve some comments
Diffstat (limited to 'tools/gfx/d3d-util.h')
| -rw-r--r-- | tools/gfx/d3d-util.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/gfx/d3d-util.h b/tools/gfx/d3d-util.h index 04bfae63d..0c05bed46 100644 --- a/tools/gfx/d3d-util.h +++ b/tools/gfx/d3d-util.h @@ -8,10 +8,13 @@ #include "../../slang-com-ptr.h" #include "../../source/core/list.h" +#include "flag-combiner.h" + #include "render.h" #include <D3Dcommon.h> #include <DXGIFormat.h> +#include <dxgi.h> namespace gfx { @@ -56,6 +59,21 @@ class D3DUtil /// Append text in in, into wide char array static void appendWideChars(const char* in, Slang::List<wchar_t>& out); + + + static SlangResult createFactory(DeviceCheckFlags flags, Slang::ComPtr<IDXGIFactory>& outFactory); + + /// Get the dxgiModule + static HMODULE getDxgiModule(); + + /// Find adapters + static SlangResult findAdapters(DeviceCheckFlags flags, const Slang::UnownedStringSlice& adapaterName, IDXGIFactory* dxgiFactory, Slang::List<Slang::ComPtr<IDXGIAdapter>>& dxgiAdapters); + /// Find adapters + static SlangResult findAdapters(DeviceCheckFlags flags, const Slang::UnownedStringSlice& adapaterName, Slang::List<Slang::ComPtr<IDXGIAdapter>>& dxgiAdapters); + + /// True if the adapter is warp + static bool isWarp(IDXGIFactory* dxgiFactory, IDXGIAdapter* adapter); + }; } // renderer_test |
