From 1901b9308fe7f47a020fc26137f4729dce388bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sun, 29 Sep 2024 15:41:55 +0800 Subject: [PATCH] GPU: use adapterLuid as deviceID for non-pci devices --- src/detection/gpu/gpu_windows.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/detection/gpu/gpu_windows.c b/src/detection/gpu/gpu_windows.c index cca409725..2a29d83a9 100644 --- a/src/detection/gpu/gpu_windows.c +++ b/src/detection/gpu/gpu_windows.c @@ -92,7 +92,10 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist* gpu->shared.total = sharedSystemMemory; } - ffRegReadUint64(hDirectxKey, L"AdapterLuid", &adapterLuid, NULL); + if (ffRegReadUint64(hDirectxKey, L"AdapterLuid", &adapterLuid, NULL)) + { + if (!gpu->deviceId) gpu->deviceId = adapterLuid; + } uint32_t featureLevel = 0; if(ffRegReadUint(hDirectxKey, L"MaxD3D12FeatureLevel", &featureLevel, NULL) && featureLevel)