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

Steve Lhomme git at videolan.org
Mon Dec 3 17:53:28 CET 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Nov 29 12:29:07 2018 +0100| [476079cf6f34d00ba5403730dcebdf1766dee8b0] | committer: Steve Lhomme

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

They display garbage otherwise

(cherry picked from commit 1882a005d9607bea702a2b4ea8b95c8f467f855a)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=476079cf6f34d00ba5403730dcebdf1766dee8b0
---

 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 32d06caa00..2bd2523897 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1481,6 +1481,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)
@@ -1488,7 +1511,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->picQuad.formatInfo, &sys->display, fmt->transfer, fmt->primaries,



More information about the vlc-commits mailing list