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.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tools/gfx/render.cpp') diff --git a/tools/gfx/render.cpp b/tools/gfx/render.cpp index 38af85f79..e618c8f8c 100644 --- a/tools/gfx/render.cpp +++ b/tools/gfx/render.cpp @@ -389,4 +389,17 @@ ProjectionStyle RendererUtil::getProjectionStyle(RendererType type) } } +/* static */UnownedStringSlice RendererUtil::toText(RendererType type) +{ + switch (type) + { + case RendererType::DirectX11: return UnownedStringSlice::fromLiteral("DirectX11"); + case RendererType::DirectX12: return UnownedStringSlice::fromLiteral("DirectX11"); + case RendererType::OpenGl: return UnownedStringSlice::fromLiteral("OpenGL"); + case RendererType::Vulkan: return UnownedStringSlice::fromLiteral("Vulkan"); + case RendererType::Unknown: return UnownedStringSlice::fromLiteral("Unknown"); + default: return UnownedStringSlice::fromLiteral("?!?"); + } +} + } // renderer_test -- cgit v1.2.3