[vlc-commits] d3d11: use vlc_viewpoint_to_4x4 to generate view matrix
Alexandre Janniaux
git at videolan.org
Mon Mar 11 10:04:17 CET 2019
vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Fri Mar 8 10:35:44 2019 +0100| [c4c3228a6271bf7a261424c81ce965b3d3af89a3] | committer: Steve Lhomme
d3d11: use vlc_viewpoint_to_4x4 to generate view matrix
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c4c3228a6271bf7a261424c81ce965b3d3af89a3
---
modules/video_output/win32/d3d11_shaders.c | 1 +
modules/video_output/win32/d3d11_shaders.h | 1 +
modules/video_output/win32/direct3d11.c | 4 ++++
3 files changed, 6 insertions(+)
diff --git a/modules/video_output/win32/d3d11_shaders.c b/modules/video_output/win32/d3d11_shaders.c
index fb621d2d39..a591e43854 100644
--- a/modules/video_output/win32/d3d11_shaders.c
+++ b/modules/video_output/win32/d3d11_shaders.c
@@ -169,6 +169,7 @@ cbuffer VS_PROJECTION_CONST : register(b0)\n\
float4x4 RotX;\n\
float4x4 RotY;\n\
float4x4 RotZ;\n\
+ float4x4 View;\n\
float4x4 Zoom;\n\
float4x4 Projection;\n\
};\n\
diff --git a/modules/video_output/win32/d3d11_shaders.h b/modules/video_output/win32/d3d11_shaders.h
index 3a84b99746..c7582972ce 100644
--- a/modules/video_output/win32/d3d11_shaders.h
+++ b/modules/video_output/win32/d3d11_shaders.h
@@ -69,6 +69,7 @@ typedef struct {
FLOAT RotX[4*4];
FLOAT RotY[4*4];
FLOAT RotZ[4*4];
+ FLOAT View[4*4];
FLOAT Zoom[4*4];
FLOAT Projection[4*4];
} VS_PROJECTION_CONST;
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index c84e4e85d6..53f10a74dc 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -803,6 +803,10 @@ static void SetQuadVSProjection(vout_display_t *vd, d3d_quad_t *quad, const vlc_
getZRotMatrix(f_roll, dst_data->RotZ);
getZoomMatrix(SPHERE_RADIUS * f_z, dst_data->Zoom);
getProjectionMatrix(f_sar, f_fovy, dst_data->Projection);
+
+ vlc_viewpoint_t vp;
+ vlc_viewpoint_reverse(&vp, p_vp);
+ vlc_viewpoint_to_4x4(&vp, dst_data->View);
}
ID3D11DeviceContext_Unmap(sys->d3d_dev.d3dcontext, (ID3D11Resource *)quad->pVertexShaderConstants, 0);
#undef RAD
More information about the vlc-commits
mailing list