[vlc-commits] Direct3D: pass dimensions of the D3D region to the pixel shader

Felix Abecassis git at videolan.org
Thu Feb 13 19:39:53 CET 2014


vlc | branch: master | Felix Abecassis <felix.abecassis at gmail.com> | Thu Feb 13 18:33:40 2014 +0100| [c765ee0b504dafcb460f964518a5af3821a662d7] | committer: Jean-Baptiste Kempf

Direct3D: pass dimensions of the D3D region to the pixel shader

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

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

 modules/video_output/msw/direct3d.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/modules/video_output/msw/direct3d.c b/modules/video_output/msw/direct3d.c
index 7b31e90..ff0f601 100644
--- a/modules/video_output/msw/direct3d.c
+++ b/modules/video_output/msw/direct3d.c
@@ -1559,7 +1559,15 @@ static int Direct3DRenderRegion(vout_display_t *vd,
 
     if (sys->d3dx_shader) {
         if (use_pixel_shader)
+        {
             hr = IDirect3DDevice9_SetPixelShader(d3ddev, sys->d3dx_shader);
+            float shader_data[4] = { region->width, region->height, 0, 0 };
+            hr = IDirect3DDevice9_SetPixelShaderConstantF(d3ddev, 0, shader_data, 1);
+            if (FAILED(hr)) {
+                msg_Dbg(vd, "%s:%d (hr=0x%0lX)", __FUNCTION__, __LINE__, hr);
+                return -1;
+            }
+        }
         else /* Disable any existing pixel shader. */
             hr = IDirect3DDevice9_SetPixelShader(d3ddev, NULL);
         if (FAILED(hr)) {



More information about the vlc-commits mailing list