From 2f4029a753f72833c30c4e6bad28c06b20540384 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 25 Mar 2019 11:48:10 -0400 Subject: 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 --- tools/gfx/render.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tools/gfx/render.h') diff --git a/tools/gfx/render.h b/tools/gfx/render.h index 775e71613..eebeaa170 100644 --- a/tools/gfx/render.h +++ b/tools/gfx/render.h @@ -779,8 +779,9 @@ public: struct Desc { - int width; ///< Width in pixels - int height; ///< height in pixels + int width; ///< Width in pixels + int height; ///< height in pixels + Slang::String adapter; ///< Name to identify the adapter to use }; virtual SlangResult initialize(const Desc& desc, void* inWindowHandle) = 0; @@ -978,6 +979,9 @@ struct RendererUtil /// Get the binding style from the type static BindingStyle getBindingStyle(RendererType type) { return s_rendererTypeToBindingStyle[int(type)]; } + /// Get as text + static Slang::UnownedStringSlice toText(RendererType type); + private: static void compileTimeAsserts(); static const uint8_t s_formatSize[]; // Maps Format::XXX to a size in bytes; -- cgit v1.2.3