Commit c30147e5 authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf

direct3d11: do not use D3D11 on older systems unless forced

Using D3D 11.1 means we are at least on Windows 8.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 3d329b56
......@@ -1675,10 +1675,16 @@ static int Direct3D11Open(vout_display_t *vd, video_format_t *fmt)
#endif
};
D3D_FEATURE_LEVEL features[] = {
D3D_FEATURE_LEVEL_11_1, D3D_FEATURE_LEVEL_11_0,
D3D_FEATURE_LEVEL_10_1, D3D_FEATURE_LEVEL_10_0,
D3D_FEATURE_LEVEL_9_3, D3D_FEATURE_LEVEL_9_2, D3D_FEATURE_LEVEL_9_1
};
for (UINT driver = 0; driver < ARRAYSIZE(driverAttempts); driver++) {
D3D_FEATURE_LEVEL i_feature_level;
hr = D3D11CreateDevice(NULL, driverAttempts[driver], NULL, creationFlags,
NULL, 0, D3D11_SDK_VERSION,
features, ARRAY_SIZE(features), D3D11_SDK_VERSION,
&sys->d3ddevice, &i_feature_level, &sys->d3dcontext);
if (SUCCEEDED(hr)) {
#ifndef NDEBUG
......@@ -1686,7 +1692,12 @@ static int Direct3D11Open(vout_display_t *vd, video_format_t *fmt)
(void *)sys->d3ddevice, (void *)sys->d3dcontext,
driverAttempts[driver], i_feature_level);
#endif
break;
if ( vd->obj.force || i_feature_level >= D3D_FEATURE_LEVEL_11_1 )
break;
ID3D11DeviceContext_Release(sys->d3dcontext);
sys->d3dcontext = NULL;
ID3D11Device_Release(sys->d3ddevice);
sys->d3ddevice = NULL;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment