Update DX12 backend to interpret CacheCoherentUMA devices as IntegratedGpu
@@ -869,12 +869,24 @@ impl hal::Instance<Backend> for Instance {
name.to_string_lossy().into_owned()
};
+ let mut features_architecture: d3d12::D3D12_FEATURE_DATA_ARCHITECTURE =
+ unsafe { mem::zeroed() };
+ assert_eq!(winerror::S_OK, unsafe {
+ device.CheckFeatureSupport(
+ d3d12::D3D12_FEATURE_ARCHITECTURE,
+ &mut features_architecture as *mut _ as *mut _,
+ mem::size_of::<d3d12::D3D12_FEATURE_DATA_ARCHITECTURE>() as _,
+ )
+ });
+
let info = adapter::AdapterInfo {
name: device_name,
vendor: desc.VendorId as usize,
device: desc.DeviceId as usize,
device_type: if (desc.Flags & dxgi::DXGI_ADAPTER_FLAG_SOFTWARE) != 0 {
adapter::DeviceType::VirtualGpu
+ } else if features_architecture.CacheCoherentUMA == TRUE {
+ adapter::DeviceType::IntegratedGpu
} else {
adapter::DeviceType::DiscreteGpu
},
@@ -889,16 +901,6 @@ impl hal::Instance<Backend> for Instance {
)
});
- let mut features_architecture: d3d12::D3D12_FEATURE_DATA_ARCHITECTURE =
- unsafe { mem::zeroed() };
- assert_eq!(winerror::S_OK, unsafe {
- device.CheckFeatureSupport(
- d3d12::D3D12_FEATURE_ARCHITECTURE,
- &mut features_architecture as *mut _ as *mut _,
- mem::size_of::<d3d12::D3D12_FEATURE_DATA_ARCHITECTURE>() as _,
- )
- });
-
let depth_bounds_test_supported = {
let mut features2: d3d12::D3D12_FEATURE_DATA_D3D12_OPTIONS2 =
unsafe { mem::zeroed() };
