vlc | branch: master | Steve Lhomme <[email protected]> | Tue Nov 22 11:59:44 
2016 +0100| [687fe78e4900131ad66de4a6e4586f0fa27cad33] | committer: 
Jean-Baptiste Kempf

direct3d11: the flat Vertex Shader doesn't need any constants

Signed-off-by: Jean-Baptiste Kempf <[email protected]>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=687fe78e4900131ad66de4a6e4586f0fa27cad33
---

 modules/video_output/win32/direct3d11.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/modules/video_output/win32/direct3d11.c 
b/modules/video_output/win32/direct3d11.c
index eeef392..1aa7128 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -2077,15 +2077,18 @@ static int AllocQuad(vout_display_t *vd, const 
video_format_t *fmt, d3d_quad_t *
     }
 
     /* vertex shader constant buffer */
-    constantDesc.ByteWidth = sizeof(VS_PROJECTION_CONST);
-    static_assert((sizeof(VS_PROJECTION_CONST)%16)==0,"Constant buffers 
require 16-byte alignment");
-    hr = ID3D11Device_CreateBuffer(sys->d3ddevice, &constantDesc, NULL, 
&quad->pVertexShaderConstants);
-    if(FAILED(hr)) {
-        msg_Err(vd, "Could not create the vertex shader constant buffer. 
(hr=0x%lX)", hr);
-        goto error;
-    }
+    if ( projection == PROJECTION_MODE_EQUIRECTANGULAR )
+    {
+        constantDesc.ByteWidth = sizeof(VS_PROJECTION_CONST);
+        static_assert((sizeof(VS_PROJECTION_CONST)%16)==0,"Constant buffers 
require 16-byte alignment");
+        hr = ID3D11Device_CreateBuffer(sys->d3ddevice, &constantDesc, NULL, 
&quad->pVertexShaderConstants);
+        if(FAILED(hr)) {
+            msg_Err(vd, "Could not create the vertex shader constant buffer. 
(hr=0x%lX)", hr);
+            goto error;
+        }
 
-    SetQuadVSProjection( vd, quad, &vd->cfg->viewpoint );
+        SetQuadVSProjection( vd, quad, &vd->cfg->viewpoint );
+    }
 
     D3D11_TEXTURE2D_DESC texDesc;
     memset(&texDesc, 0, sizeof(texDesc));

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to