[vlc-devel] [PATCH] direct3d11: fix the horizontally flipped texture
Steve Lhomme
robux4 at videolabs.io
Tue Dec 6 11:12:47 CET 2016
Now the projection matrices correspond to the one from OpenGL and DirectXMath.
---
modules/video_output/win32/direct3d11.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 29702a1..6a5cc45 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));
@@ -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
More information about the vlc-devel
mailing list