[vlc-commits] direct3d9: only enable the StretchRect replacement for NVIDIA

Steve Lhomme git at videolan.org
Mon Mar 9 15:28:23 CET 2020


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Mar  5 10:06:46 2020 +0100| [e425b28e36c1963bc3cb6a5accc1d4680de74174] | committer: Steve Lhomme

direct3d9: only enable the StretchRect replacement for NVIDIA

According to #19723 only NVIDIA cards have the "issue" where the StretchRect
doesn't do the limited to full conversion.

The new code works for all manufacturers but it's safer to rely on StretchRect
for now.

(cherry picked from commit f24b1c94c34510cd281f7f9015f8cfe74a3e85c7)

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

 modules/video_output/win32/direct3d9.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index 1709eef504..0548738207 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -993,8 +993,13 @@ static int Direct3D9Open(vout_display_t *vd, video_format_t *fmt)
         msg_Warn(vd, "Unknown back buffer format 0x%X", p_d3d9_dev->pp.BackBufferFormat);
     else if (!vd->source.b_color_range_full && d3dbuffer->rmask && !d3dfmt->rmask)
     {
-        // NVIDIA bug, YUV to RGB internal conversion in StretchRect always converts from limited to limited range
-        InitRangeProcessor( vd, d3dfmt );
+        D3DADAPTER_IDENTIFIER9 d3dai;
+        if (sys->hd3d.use_ex && SUCCEEDED(IDirect3D9Ex_GetAdapterIdentifier(sys->hd3d.objex, sys->d3d_dev.adapterId, 0, &d3dai)) && 
+            d3dai.VendorId == GPU_MANUFACTURER_NVIDIA) {
+
+            // NVIDIA bug, YUV to RGB internal conversion in StretchRect always converts from limited to limited range
+            InitRangeProcessor( vd, d3dfmt );
+        }
     }
 
     fmt->i_chroma = d3dfmt->fourcc;



More information about the vlc-commits mailing list