diff options
| author | skallweitNV <64953474+skallweitNV@users.noreply.github.com> | 2022-11-04 17:34:53 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-04 17:34:53 +0100 |
| commit | 015bde8d5a46f32979c00dbb1feb4b3d80729c44 (patch) | |
| tree | b95713bb080d0fbcb11d9b2519b9166e11fe5dde /tools/gfx/d3d12 | |
| parent | 9a3a4b08c8817905c2f608549c0e57216f8068c5 (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/d3d12')
| -rw-r--r-- | tools/gfx/d3d12/d3d12-device.cpp | 8 | ||||
| -rw-r--r-- | tools/gfx/d3d12/d3d12-device.h | 2 | ||||
| -rw-r--r-- | tools/gfx/d3d12/d3d12-helper-functions.cpp | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/tools/gfx/d3d12/d3d12-device.cpp b/tools/gfx/d3d12/d3d12-device.cpp index c87e6b4ca..ebb416c39 100644 --- a/tools/gfx/d3d12/d3d12-device.cpp +++ b/tools/gfx/d3d12/d3d12-device.cpp @@ -277,7 +277,7 @@ Result DeviceImpl::getNativeDeviceHandles(InteropHandles* outHandles) Result DeviceImpl::_createDevice( DeviceCheckFlags deviceCheckFlags, - const UnownedStringSlice& nameMatch, + const AdapterLUID* adapterLUID, D3D_FEATURE_LEVEL featureLevel, D3D12DeviceInfo& outDeviceInfo) { @@ -293,7 +293,7 @@ Result DeviceImpl::_createDevice( List<ComPtr<IDXGIAdapter>> dxgiAdapters; SLANG_RETURN_ON_FAIL( - D3DUtil::findAdapters(deviceCheckFlags, nameMatch, dxgiFactory, dxgiAdapters)); + D3DUtil::findAdapters(deviceCheckFlags, adapterLUID, dxgiFactory, dxgiAdapters)); ComPtr<ID3D12Device> device; ComPtr<IDXGIAdapter> adapter; @@ -471,7 +471,7 @@ Result DeviceImpl::initialize(const Desc& desc) if (SLANG_SUCCEEDED(m_D3D12GetDebugInterface(IID_PPV_ARGS(m_dxDebug.writeRef())))) { # if 0 - // Can enable for extra validation. NOTE! That d3d12 warns if you do.... + // Can enable for extra validation. NOTE! That d3d12 warns if you do.... // D3D12 MESSAGE : Device Debug Layer Startup Options : GPU - Based Validation is enabled(disabled by default). // This results in new validation not possible during API calls on the CPU, by creating patched shaders that have validation // added directly to the shader. However, it can slow things down a lot, especially for applications with numerous @@ -534,7 +534,7 @@ Result DeviceImpl::initialize(const Desc& desc) { if (SLANG_SUCCEEDED(_createDevice( combiner.getCombination(i), - UnownedStringSlice(desc.adapter), + desc.adapterLUID, featureLevel, m_deviceInfo))) { diff --git a/tools/gfx/d3d12/d3d12-device.h b/tools/gfx/d3d12/d3d12-device.h index 38b3251fd..fb54e5543 100644 --- a/tools/gfx/d3d12/d3d12-device.h +++ b/tools/gfx/d3d12/d3d12-device.h @@ -236,7 +236,7 @@ public: Result _createDevice( DeviceCheckFlags deviceCheckFlags, - const UnownedStringSlice& nameMatch, + const AdapterLUID* adapterLUID, D3D_FEATURE_LEVEL featureLevel, D3D12DeviceInfo& outDeviceInfo); diff --git a/tools/gfx/d3d12/d3d12-helper-functions.cpp b/tools/gfx/d3d12/d3d12-helper-functions.cpp index 34efa8401..efa379786 100644 --- a/tools/gfx/d3d12/d3d12-helper-functions.cpp +++ b/tools/gfx/d3d12/d3d12-helper-functions.cpp @@ -616,8 +616,7 @@ void translatePostBuildInfoDescs( Result SLANG_MCALL getD3D12Adapters(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) @@ -629,6 +628,7 @@ Result SLANG_MCALL getD3D12Adapters(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; |
