[vlc-commits] direct3d11: only change the pixel shader if the first output texture is DXGI_FORMAT_R8_UNORM

Steve Lhomme git at videolan.org
Thu Sep 10 18:09:46 CEST 2015


vlc | branch: master | Steve Lhomme <robux4 at gmail.com> | Fri Jul 31 16:54:45 2015 +0200| [49ea9bbc5b9e1d64754a2c96b34df7373954df1d] | committer: Jean-Baptiste Kempf

direct3d11: only change the pixel shader if the first output texture is DXGI_FORMAT_R8_UNORM

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/video_output/msw/direct3d11.c |   44 +++++++++++++++++----------------
 1 file changed, 23 insertions(+), 21 deletions(-)

diff --git a/modules/video_output/msw/direct3d11.c b/modules/video_output/msw/direct3d11.c
index 8850aff..a03a3e9 100644
--- a/modules/video_output/msw/direct3d11.c
+++ b/modules/video_output/msw/direct3d11.c
@@ -1095,29 +1095,31 @@ static int Direct3D11Open(vout_display_t *vd, video_format_t *fmt)
         sys->d3dregion_format = DXGI_FORMAT_UNKNOWN;
     }
 
-    switch (fmt->i_chroma)
+    sys->d3dPxShader = globPixelShaderDefault;
+    if (sys->picQuadConfig.resourceFormatYRGB == DXGI_FORMAT_R8_UNORM)
     {
-    case VLC_CODEC_NV12:
-    case VLC_CODEC_D3D11_OPAQUE:
-        if( fmt->i_height > 576 )
-            sys->d3dPxShader = globPixelShaderBiplanarYUV_BT709_2RGB;
-        else
-            sys->d3dPxShader = globPixelShaderBiplanarYUV_BT601_2RGB;
-        break;
-    case VLC_CODEC_YV12:
-    case VLC_CODEC_I420:
-        if( fmt->i_height > 576 )
-            sys->d3dPxShader = globPixelShaderBiplanarI420_BT709_2RGB;
-        else
-            sys->d3dPxShader = globPixelShaderBiplanarI420_BT601_2RGB;
-        break;
-    case VLC_CODEC_RGB32:
-    case VLC_CODEC_BGRA:
-    case VLC_CODEC_RGB16:
-    default:
-        sys->d3dPxShader = globPixelShaderDefault;
-        break;
+        switch (fmt->i_chroma)
+        {
+        case VLC_CODEC_NV12:
+        case VLC_CODEC_D3D11_OPAQUE:
+            if( fmt->i_height > 576 )
+                sys->d3dPxShader = globPixelShaderBiplanarYUV_BT709_2RGB;
+            else
+                sys->d3dPxShader = globPixelShaderBiplanarYUV_BT601_2RGB;
+            break;
+        case VLC_CODEC_YV12:
+        case VLC_CODEC_I420:
+            if( fmt->i_height > 576 )
+                sys->d3dPxShader = globPixelShaderBiplanarI420_BT709_2RGB;
+            else
+                sys->d3dPxShader = globPixelShaderBiplanarI420_BT601_2RGB;
+            break;
+        default:
+            vlc_assert_unreachable();
+            break;
+        }
     }
+
     if (sys->d3dregion_format != DXGI_FORMAT_UNKNOWN)
         sys->psz_rgbaPxShader = globPixelShaderDefault;
     else



More information about the vlc-commits mailing list