summaryrefslogtreecommitdiffstats
path: root/tools/gfx/d3d11
diff options
context:
space:
mode:
authorskallweitNV <64953474+skallweitNV@users.noreply.github.com>2022-11-04 17:34:53 +0100
committerGitHub <noreply@github.com>2022-11-04 17:34:53 +0100
commit015bde8d5a46f32979c00dbb1feb4b3d80729c44 (patch)
treeb95713bb080d0fbcb11d9b2519b9166e11fe5dde /tools/gfx/d3d11
parent9a3a4b08c8817905c2f608549c0e57216f8068c5 (diff)
Add AdapterLUID to identify GPU adapters (#2492)
* Add AdapterLUID to identify GPU adapters * Remove adapter option in render-test
Diffstat (limited to 'tools/gfx/d3d11')
-rw-r--r--tools/gfx/d3d11/d3d11-device.cpp10
-rw-r--r--tools/gfx/d3d11/d3d11-helper-functions.cpp4
2 files changed, 7 insertions, 7 deletions
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<IDXGIAdapter> adapter;
- if (desc.adapter && (deviceCheckFlags & DeviceCheckFlag::UseHardwareDevice))
+ if (desc.adapterLUID)
{
List<ComPtr<IDXGIAdapter>> 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,
diff --git a/tools/gfx/d3d11/d3d11-helper-functions.cpp b/tools/gfx/d3d11/d3d11-helper-functions.cpp
index 93065077a..4e1df9879 100644
--- a/tools/gfx/d3d11/d3d11-helper-functions.cpp
+++ b/tools/gfx/d3d11/d3d11-helper-functions.cpp
@@ -348,8 +348,7 @@ namespace d3d11
Result SLANG_MCALL getD3D11Adapters(List<AdapterInfo>& outAdapters)
{
List<ComPtr<IDXGIAdapter>> dxgiAdapters;
- DeviceCheckFlags flags = DeviceCheckFlag::UseHardwareDevice;
- SLANG_RETURN_ON_FAIL(D3DUtil::findAdapters(flags, UnownedStringSlice(), dxgiAdapters));
+ SLANG_RETURN_ON_FAIL(D3DUtil::findAdapters(DeviceCheckFlag::UseHardwareDevice, nullptr, dxgiAdapters));
outAdapters.clear();
for (const auto& dxgiAdapter : dxgiAdapters)
@@ -361,6 +360,7 @@ Result SLANG_MCALL getD3D11Adapters(List<AdapterInfo>& outAdapters)
memcpy(info.name, name.getBuffer(), Math::Min(name.getLength(), (Index)sizeof(AdapterInfo::name) - 1));
info.vendorID = desc.VendorId;
info.deviceID = desc.DeviceId;
+ info.luid = D3DUtil::getAdapterLUID(dxgiAdapter);
outAdapters.add(info);
}
return SLANG_OK;