diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2017-08-19 01:35:50 +0300 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2017-08-19 01:35:50 +0300 |
commit | bd3b16bd2e607ed2eb669230ef2dde32092c4226 (patch) | |
tree | 82b09d6a4eb2790e45132af340afd0b7049d00ac /decoder/LAVVideo | |
parent | 8cb9e78779249cafbb76d149ee52d6f31a5426d2 (diff) |
d3d11: request devices up to feature level 11.1
As a side-effect, this blocks execution on any system that does not have
the full 11.1 runtime, like Windows Vista/7.
Diffstat (limited to 'decoder/LAVVideo')
-rw-r--r-- | decoder/LAVVideo/decoders/d3d11va.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/decoder/LAVVideo/decoders/d3d11va.cpp b/decoder/LAVVideo/decoders/d3d11va.cpp index c9266b32..3107deab 100644 --- a/decoder/LAVVideo/decoders/d3d11va.cpp +++ b/decoder/LAVVideo/decoders/d3d11va.cpp @@ -31,6 +31,17 @@ ILAVDecoder *CreateDecoderD3D11() // D3D11 decoder implementation //////////////////////////////////////////////////////////////////////////////// +static const D3D_FEATURE_LEVEL s_D3D11Levels[] = +{ + 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, +}; + CDecD3D11::CDecD3D11(void) : CDecAvcodec() { @@ -128,7 +139,7 @@ STDMETHODIMP CDecD3D11::Check() { // attempt creating a hardware device with video support // by passing nullptr to the device parameter, no actual device will be created and only support will be checked - HRESULT hr = dx.mD3D11CreateDevice(nullptr, D3D_DRIVER_TYPE_HARDWARE, nullptr, D3D11_CREATE_DEVICE_VIDEO_SUPPORT, nullptr, 0, D3D11_SDK_VERSION, nullptr, nullptr, nullptr); + HRESULT hr = dx.mD3D11CreateDevice(nullptr, D3D_DRIVER_TYPE_HARDWARE, nullptr, D3D11_CREATE_DEVICE_VIDEO_SUPPORT, s_D3D11Levels, countof(s_D3D11Levels), D3D11_SDK_VERSION, nullptr, nullptr, nullptr); return hr; } @@ -190,7 +201,8 @@ enum_adapter: } } - hr = dx.mD3D11CreateDevice(pDXGIAdapter, D3D_DRIVER_TYPE_UNKNOWN, nullptr, D3D11_CREATE_DEVICE_VIDEO_SUPPORT, nullptr, 0, D3D11_SDK_VERSION, &pD3D11Device, nullptr, nullptr); + D3D_FEATURE_LEVEL d3dFeatureLevel; + hr = dx.mD3D11CreateDevice(pDXGIAdapter, D3D_DRIVER_TYPE_UNKNOWN, nullptr, D3D11_CREATE_DEVICE_VIDEO_SUPPORT, s_D3D11Levels, countof(s_D3D11Levels), D3D11_SDK_VERSION, &pD3D11Device, &d3dFeatureLevel, nullptr); if (FAILED(hr)) { if (nDeviceIndex != 0) @@ -205,6 +217,8 @@ enum_adapter: goto fail; } + DbgLog((LOG_TRACE, 10, L"-> Created D3D11 device with feature level %d.%d", d3dFeatureLevel >> 12, (d3dFeatureLevel >> 8) & 0xF)); + // enable multithreaded protection ID3D10Multithread *pMultithread = nullptr; hr = pD3D11Device->QueryInterface(&pMultithread); |