[vlc-commits] d3d11: make sure the WDDM version is always set for all d3d11_device we create
Steve Lhomme
git at videolan.org
Wed Jan 17 18:38:27 CET 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jan 17 18:10:26 2018 +0100| [3e4d3f6bf2bbc74e832bbd8de72e3d10c662d808] | committer: 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 <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3e4d3f6bf2bbc74e832bbd8de72e3d10c662d808
---
modules/codec/avcodec/d3d11va.c | 1 +
modules/hw/d3d11/d3d11_instance.c | 1 +
modules/video_chroma/d3d11_fmt.c | 5 +++--
modules/video_chroma/d3d11_fmt.h | 2 ++
4 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index 83a3e577ba..d38b59ad3a 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -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);
diff --git a/modules/hw/d3d11/d3d11_instance.c b/modules/hw/d3d11/d3d11_instance.c
index 0e19398eae..d9a2ebfb0d 100644
--- a/modules/hw/d3d11/d3d11_instance.c
+++ b/modules/hw/d3d11/d3d11_instance.c
@@ -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);
diff --git a/modules/video_chroma/d3d11_fmt.c b/modules/video_chroma/d3d11_fmt.c
index 9ebd7ff5b3..e35da8ef0d 100644
--- a/modules/video_chroma/d3d11_fmt.c
+++ b/modules/video_chroma/d3d11_fmt.c
@@ -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;
diff --git a/modules/video_chroma/d3d11_fmt.h b/modules/video_chroma/d3d11_fmt.h
index 94e0a08cf1..e5dfaefe37 100644
--- a/modules/video_chroma/d3d11_fmt.h
+++ b/modules/video_chroma/d3d11_fmt.h
@@ -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)
More information about the vlc-commits
mailing list