[vlc-commits] direct3d11: reorder some calls
Steve Lhomme
git at videolan.org
Wed Jun 17 14:55:42 CEST 2015
vlc | branch: master | Steve Lhomme <robux4 at gmail.com> | Wed Jun 17 12:20:54 2015 +0200| [22fa052852ea484fb05dbfcd79784698eb1e44d6] | committer: Jean-Baptiste Kempf
direct3d11: reorder some calls
When sharing the D3D11 context some settings may be overridden,
so we make sure we always have the right setup to render
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=22fa052852ea484fb05dbfcd79784698eb1e44d6
---
modules/video_output/msw/direct3d11.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/modules/video_output/msw/direct3d11.c b/modules/video_output/msw/direct3d11.c
index 2b515ca..5aea110 100644
--- a/modules/video_output/msw/direct3d11.c
+++ b/modules/video_output/msw/direct3d11.c
@@ -687,8 +687,6 @@ static HRESULT UpdateBackBuffer(vout_display_t *vd)
return hr;
}
- ID3D11DeviceContext_OMSetRenderTargets(sys->d3dcontext, 1, &sys->d3drenderTargetView, sys->d3ddepthStencilView);
-
D3D11_VIEWPORT vp;
vp.Width = (FLOAT)RECTWidth(sys->rect_dest_clipped);
vp.Height = (FLOAT)RECTHeight(sys->rect_dest_clipped);
@@ -740,12 +738,6 @@ static void Prepare(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
0, &box);
}
-#if VLC_WINSTORE_APP /* TODO: Choose the WinRT app background clear color */
- float ClearColor[4] = { 1.0f, 0.125f, 0.3f, 1.0f };
- ID3D11DeviceContext_ClearRenderTargetView(sys->d3dcontext,sys->d3drenderTargetView, ClearColor);
-#endif
- ID3D11DeviceContext_ClearDepthStencilView(sys->d3dcontext,sys->d3ddepthStencilView, D3D11_CLEAR_DEPTH, 1.0f, 0);
-
if (subpicture) {
int subpicture_region_count = 0;
picture_t **subpicture_regions = NULL;
@@ -778,6 +770,10 @@ static void Display(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
/* no ID3D11Device operations should come here */
+ ID3D11DeviceContext_OMSetRenderTargets(sys->d3dcontext, 1, &sys->d3drenderTargetView, sys->d3ddepthStencilView);
+
+ ID3D11DeviceContext_ClearDepthStencilView(sys->d3dcontext, sys->d3ddepthStencilView, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0f, 0);
+
/* Render the quad */
DisplayD3DPicture(sys, &sys->picQuad);
More information about the vlc-commits
mailing list