[vlc-devel] [PATCH 2/2] Direct3D: pass dimensions of the D3D region to the pixel shader
Felix Abecassis
felix.abecassis at gmail.com
Thu Feb 13 18:33:40 CET 2014
---
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 b25eb9b..9c5e4c2 100644
--- a/modules/video_output/msw/direct3d.c
+++ b/modules/video_output/msw/direct3d.c
@@ -1558,7 +1558,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)) {
--
1.7.10.4
More information about the vlc-devel
mailing list