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

d3d11: make sure the WDDM version is always set for all d3d11_device we create

Fixes Intel detection failing in d3d11va.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent d161752d
......@@ -357,6 +357,7 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
sys->d3d_dev.d3dcontext = p_sys->context;
sys->d3d_dev.owner = false;
D3D11_GetDriverVersion(va, &sys->d3d_dev);
sys->d3dvidctx = d3dvidctx;
assert(p_sys->texture[KNOWN_DXGI_INDEX] != NULL);
......
......@@ -83,6 +83,7 @@ void D3D11_FilterHoldInstance(filter_t *filter, d3d11_device_t *out, D3D11_TEXTU
{
ID3D11DeviceContext_AddRef(out->d3dcontext);
ID3D11Device_AddRef(out->d3ddevice);
D3D11_GetDriverVersion(filter, out);
}
vlc_mutex_unlock(&inst_lock);
......
......@@ -162,7 +162,8 @@ static HKEY GetAdapterRegistry(DXGI_ADAPTER_DESC *adapterDesc)
}
#endif
static void GetDriverVersion(vlc_object_t *obj, d3d11_device_t *d3d_dev)
#undef D3D11_GetDriverVersion
void D3D11_GetDriverVersion(vlc_object_t *obj, d3d11_device_t *d3d_dev)
{
memset(&d3d_dev->WDDM, 0, sizeof(d3d_dev->WDDM));
#if VLC_WINSTORE_APP
......@@ -291,7 +292,7 @@ HRESULT D3D11_CreateDevice(vlc_object_t *obj, d3d11_handle_t *hd3d,
if (SUCCEEDED(hr))
{
out->owner = true;
GetDriverVersion(obj, out);
D3D11_GetDriverVersion(obj, out);
}
return hr;
......
......@@ -111,6 +111,8 @@ bool isNvidiaHardware(ID3D11Device *d3ddev);
IDXGIAdapter *D3D11DeviceAdapter(ID3D11Device *d3ddev);
int D3D11CheckDriverVersion(d3d11_device_t *, UINT vendorId,
const struct wddm_version *min_ver);
void D3D11_GetDriverVersion(vlc_object_t *, d3d11_device_t *);
#define D3D11_GetDriverVersion(a,b) D3D11_GetDriverVersion(VLC_OBJECT(a),b)
static inline bool DeviceSupportsFormat(ID3D11Device *d3ddevice,
DXGI_FORMAT format, UINT supportFlags)
......
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