@@ -47,7 +47,7 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist*
4747 gpu -> deviceId = 0 ;
4848 gpu -> frequency = FF_GPU_FREQUENCY_UNSET ;
4949
50- uint32_t pciBus , pciAddr , pciDev , pciFunc ;
50+ uint32_t pciBus = 0 , pciAddr = UINT32_MAX , pciDev = 0 , pciFunc = 0 ;
5151 if (SetupDiGetDeviceRegistryPropertyW (hdev , & did , SPDRP_BUSNUMBER , NULL , (PBYTE ) & pciBus , sizeof (pciBus ), NULL ) &&
5252 SetupDiGetDeviceRegistryPropertyW (hdev , & did , SPDRP_ADDRESS , NULL , (PBYTE ) & pciAddr , sizeof (pciAddr ), NULL ))
5353 {
@@ -92,7 +92,10 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist*
9292 gpu -> shared .total = sharedSystemMemory ;
9393 }
9494
95- ffRegReadUint64 (hDirectxKey , L"AdapterLuid" , & adapterLuid , NULL );
95+ if (ffRegReadUint64 (hDirectxKey , L"AdapterLuid" , & adapterLuid , NULL ))
96+ {
97+ if (!gpu -> deviceId ) gpu -> deviceId = adapterLuid ;
98+ }
9699
97100 uint32_t featureLevel = 0 ;
98101 if (ffRegReadUint (hDirectxKey , L"MaxD3D12FeatureLevel" , & featureLevel , NULL ) && featureLevel )
@@ -151,7 +154,7 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist*
151154 & (FFGpuDriverCondition ) {
152155 .type = FF_GPU_DRIVER_CONDITION_TYPE_DEVICE_ID
153156 | (adapterLuid > 0 ? FF_GPU_DRIVER_CONDITION_TYPE_LUID : 0 )
154- | (vendorId > 0 ? FF_GPU_DRIVER_CONDITION_TYPE_BUS_ID : 0 ),
157+ | (pciAddr > 0 ? FF_GPU_DRIVER_CONDITION_TYPE_BUS_ID : 0 ),
155158 .pciDeviceId = {
156159 .deviceId = deviceId ,
157160 .vendorId = vendorId ,
0 commit comments