[vlc-commits] direct3d11: do an extra copy when using AMD RX Vega 56/64 chips

Steve Lhomme git at videolan.org
Thu Nov 29 12:30:33 CET 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Nov 29 12:29:07 2018 +0100| [1882a005d9607bea702a2b4ea8b95c8f467f855a] | committer: Steve Lhomme

direct3d11: do an extra copy when using AMD RX Vega 56/64 chips

They display garbage otherwise

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1882a005d9607bea702a2b4ea8b95c8f467f855a
---

 modules/video_output/win32/direct3d11.c | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index ad5235a76b..c2d6c7d1ed 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1447,6 +1447,29 @@ static bool CanUseTextureArray(vout_display_t *vd)
 #endif
 }
 
+static bool BogusZeroCopy(vout_display_t *vd)
+{
+    IDXGIAdapter *p_adapter = D3D11DeviceAdapter(vd->sys->d3d_dev.d3ddevice);
+    if (!p_adapter)
+        return false;
+
+    DXGI_ADAPTER_DESC adapterDesc;
+    if (FAILED(IDXGIAdapter_GetDesc(p_adapter, &adapterDesc)))
+        return false;
+    IDXGIAdapter_Release(p_adapter);
+
+    if (adapterDesc.VendorId != GPU_MANUFACTURER_AMD)
+        return false;
+
+    switch (adapterDesc.DeviceId)
+    {
+    case 0x687F: // RX Vega 56/64
+        return true;
+    default:
+        return false;
+    }
+}
+
 /* TODO : handle errors better
    TODO : seperate out into smaller functions like createshaders */
 static int Direct3D11CreateFormatResources(vout_display_t *vd, const video_format_t *fmt)
@@ -1454,7 +1477,8 @@ static int Direct3D11CreateFormatResources(vout_display_t *vd, const video_forma
     vout_display_sys_t *sys = vd->sys;
     HRESULT hr;
 
-    sys->legacy_shader = sys->d3d_dev.feature_level < D3D_FEATURE_LEVEL_10_0 || !CanUseTextureArray(vd);
+    sys->legacy_shader = sys->d3d_dev.feature_level < D3D_FEATURE_LEVEL_10_0 || !CanUseTextureArray(vd) ||
+            BogusZeroCopy(vd);
 
     hr = D3D11_CompilePixelShader(vd, &sys->hd3d, sys->legacy_shader, &sys->d3d_dev,
                                   &sys->display, fmt->transfer, fmt->primaries,



More information about the vlc-commits mailing list