[vlc-devel] [PATCH] direct3d11: fix the horizontally flipped texture

Rémi Denis-Courmont remi at remlab.net
Tue Dec 6 18:01:08 CET 2016


On December 6, 2016 5:33:42 AM EST, Steve Lhomme <robux4 at videolabs.io> wrote:
>Now the projection matrices correspond to the one from OpenGL and
>DirectXMath.
>
>--
>replaces https://patches.videolan.org/patch/15229/
>- the mouse movements where inverted, now they are in line with OpenGL
>---
> modules/video_output/win32/direct3d11.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
>diff --git a/modules/video_output/win32/direct3d11.c
>b/modules/video_output/win32/direct3d11.c
>index 29702a1..88f3ebe 100644
>--- a/modules/video_output/win32/direct3d11.c
>+++ b/modules/video_output/win32/direct3d11.c
>@@ -828,7 +828,7 @@ static void getProjectionMatrix(float sar, float
>fovy, FLOAT matrix[static 16])
>     const FLOAT m[] = {
>         f / sar, 0.f,                   0.f,                0.f,
>         0.f,     f,                     0.f,                0.f,
>-        0.f,     0.f,    -(zNear + zFar) / (zNear - zFar),  1.f,
>+        0.f,     0.f,     (zNear + zFar) / (zNear - zFar), -1.f,
>         0.f,     0.f, (2 * zNear * zFar) / (zNear - zFar),  0.f};
> 
>      memcpy(matrix, m, sizeof(m));
>@@ -843,9 +843,9 @@ static void SetQuadVSProjection(vout_display_t *vd,
>d3d_quad_t *quad, const vlc_
>     if (SUCCEEDED(hr)) {
>         VS_PROJECTION_CONST *dst_data = mapped.pData;
> #define RAD(d) ((float) ((d) * M_PI / 180.f))
>-        getXRotMatrix(-RAD(p_vp->pitch), dst_data->RotX);
>-        getYRotMatrix(-RAD(p_vp->yaw),   dst_data->RotY);
>-        getZRotMatrix(-RAD(p_vp->roll),  dst_data->RotZ);
>+        getXRotMatrix(RAD(p_vp->pitch), dst_data->RotX);
>+        getYRotMatrix(RAD(p_vp->yaw),   dst_data->RotY);
>+        getZRotMatrix(RAD(p_vp->roll),  dst_data->RotZ);
>         getZoomMatrix(SPHERE_RADIUS, dst_data->View); /* FIXME */
>  float sar = (float) vd->cfg->display.width / vd->cfg->display.height;
>        getProjectionMatrix(sar, RAD(p_vp->fov), dst_data->Projection);
>@@ -1852,12 +1852,12 @@ static void SetupQuadSphere(d3d_vertex_t
>*dst_data, WORD *triangle_pos)
>             unsigned off = (lat * nbLatBands + lon) * 3 * 2;
> 
>             triangle_pos[off] = first;
>-            triangle_pos[off + 1] = second;
>-            triangle_pos[off + 2] = first + 1;
>+            triangle_pos[off + 1] = first + 1;
>+            triangle_pos[off + 2] = second;
> 
>             triangle_pos[off + 3] = second;
>-            triangle_pos[off + 4] = second + 1;
>-            triangle_pos[off + 5] = first + 1;
>+            triangle_pos[off + 4] = first + 1;
>+            triangle_pos[off + 5] = second + 1;
>         }
>     }
> }
>-- 
>2.10.1
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

Rejected
-- 
Rémi Denis-Courmont


More information about the vlc-devel mailing list