From 015bde8d5a46f32979c00dbb1feb4b3d80729c44 Mon Sep 17 00:00:00 2001 From: skallweitNV <64953474+skallweitNV@users.noreply.github.com> Date: Fri, 4 Nov 2022 17:34:53 +0100 Subject: Add AdapterLUID to identify GPU adapters (#2492) * Add AdapterLUID to identify GPU adapters * Remove adapter option in render-test --- tools/gfx/d3d11/d3d11-device.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tools/gfx/d3d11/d3d11-device.cpp') diff --git a/tools/gfx/d3d11/d3d11-device.cpp b/tools/gfx/d3d11/d3d11-device.cpp index fbc24c9ce..4872d2a54 100644 --- a/tools/gfx/d3d11/d3d11-device.cpp +++ b/tools/gfx/d3d11/d3d11-device.cpp @@ -112,12 +112,12 @@ SlangResult DeviceImpl::initialize(const Desc& desc) const auto deviceCheckFlags = combiner.getCombination(i); D3DUtil::createFactory(deviceCheckFlags, m_dxgiFactory); - // If we have an adapter set on the desc, look it up. We only need to do so for hardware + // If we have an adapter set on the desc, look it up. ComPtr adapter; - if (desc.adapter && (deviceCheckFlags & DeviceCheckFlag::UseHardwareDevice)) + if (desc.adapterLUID) { List> dxgiAdapters; - D3DUtil::findAdapters(deviceCheckFlags, Slang::UnownedStringSlice(desc.adapter), dxgiAdapters); + D3DUtil::findAdapters(deviceCheckFlags, desc.adapterLUID, m_dxgiFactory, dxgiAdapters); if (dxgiAdapters.getCount() == 0) { continue; @@ -147,7 +147,7 @@ SlangResult DeviceImpl::initialize(const Desc& desc) m_device.writeRef(), &featureLevel, m_immediateContext.writeRef()); - // Check if successfully constructed - if so we are done. + // Check if successfully constructed - if so we are done. if (SLANG_SUCCEEDED(res)) { break; @@ -882,7 +882,7 @@ Result DeviceImpl::createInputLayout(IInputLayout::Desc const& desc, IInputLayou default: return SLANG_FAIL; } - + hlslCursor += sprintf(hlslCursor, "%s a%d : %s%d", typeName, (int)ii, -- cgit v1.2.3