]> git.sesse.net Git - vlc/commitdiff
Direct3D: pass dimensions of the D3D region to the pixel shader
authorFelix Abecassis <felix.abecassis@gmail.com>
Thu, 13 Feb 2014 17:33:40 +0000 (18:33 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 13 Feb 2014 18:39:49 +0000 (19:39 +0100)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/video_output/msw/direct3d.c

index 7b31e901ac2ecbf232007ef5f4eb85f9685613ac..ff0f601cc7119f159e06a761d68cba6868428b3f 100644 (file)
@@ -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)) {