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

Steve Lhomme git at videolan.org
Thu Mar 5 10:19:27 CET 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Mar  5 10:06:46 2020 +0100| [f24b1c94c34510cd281f7f9015f8cfe74a3e85c7] | 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.

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

 modules/video_output/win32/direct3d9.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index 8c4297c01e..541e97e675 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -1616,7 +1616,8 @@ static int Direct3D9Open(vout_display_t *vd, video_format_t *fmt)
     const d3d9_format_t *d3dbuffer = FindBufferFormat(vd, sys->BufferFormat);
     if (!d3dbuffer)
         msg_Warn(vd, "Unknown back buffer format 0x%X", sys->BufferFormat);
-    else if (vd->source.color_range != COLOR_RANGE_FULL && d3dbuffer->rmask && !d3dfmt->rmask)
+    else if (vd->source.color_range != COLOR_RANGE_FULL && d3dbuffer->rmask && !d3dfmt->rmask &&
+             sys->d3d9_device->d3ddev.identifier.VendorId == GPU_MANUFACTURER_NVIDIA)
     {
         // NVIDIA bug, YUV to RGB internal conversion in StretchRect always converts from limited to limited range
         InitRangeProcessor( vd, d3dfmt, &render_out );



More information about the vlc-commits mailing list