[vlc-commits] direct3d11: split some functions to do the render target clean before displaying
Steve Lhomme
git at videolan.org
Fri Aug 10 16:08:10 CEST 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Aug 10 13:44:17 2018 +0200| [a09d6d4b6d962c07cacc8b5be730e5792ee90e32] | committer: Steve Lhomme
direct3d11: split some functions to do the render target clean before displaying
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a09d6d4b6d962c07cacc8b5be730e5792ee90e32
---
modules/video_output/win32/direct3d11.c | 34 +++++++++++++++++++++++----------
1 file changed, 24 insertions(+), 10 deletions(-)
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 7c26449d05..71bec97e7e 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -778,11 +778,14 @@ static void Manage(vout_display_t *vd)
}
}
-static void Prepare(vout_display_t *vd, picture_t *picture,
- subpicture_t *subpicture, vlc_tick_t date)
+static void DisplayPicture(vout_display_sys_t *sys, d3d_quad_t *quad, d3d_vshader_t *vs_shader,
+ ID3D11ShaderResourceView *renderSrc[D3D11_MAX_SHADER_VIEW])
+{
+ D3D11_RenderQuad(&sys->d3d_dev, quad, vs_shader, renderSrc, sys->swapchainTargetView);
+}
+
+static void PreparePicture(vout_display_t *vd, picture_t *picture, subpicture_t *subpicture)
{
- Manage(vd);
- VLC_UNUSED(date);
vout_display_sys_t *sys = vd->sys;
if (sys->picQuad.textureFormat->formatTexture == DXGI_FORMAT_UNKNOWN)
@@ -881,8 +884,6 @@ static void Prepare(vout_display_t *vd, picture_t *picture,
sys->d3dregions = subpicture_regions;
}
- D3D11_ClearRenderTargets( &sys->d3d_dev, sys->display.pixelFormat, sys->swapchainTargetView );
-
if (picture->format.mastering.max_luminance)
{
D3D11_UpdateQuadLuminanceScale(vd, &sys->d3d_dev, &sys->picQuad, GetFormatLuminance(VLC_OBJECT(vd), &picture->format) / (float)sys->display.luminance_peak);
@@ -914,9 +915,9 @@ static void Prepare(vout_display_t *vd, picture_t *picture,
picture_sys_t *p_sys = ActivePictureSys(picture);
renderSrc = p_sys->renderSrc;
}
- D3D11_RenderQuad(&sys->d3d_dev, &sys->picQuad,
- vd->fmt.projection_mode == PROJECTION_MODE_RECTANGULAR ? &sys->flatVShader : &sys->projectionVShader,
- renderSrc, sys->swapchainTargetView);
+ DisplayPicture(sys, &sys->picQuad,
+ vd->fmt.projection_mode == PROJECTION_MODE_RECTANGULAR ? &sys->flatVShader : &sys->projectionVShader,
+ renderSrc);
if (subpicture) {
// draw the additional vertices
@@ -924,7 +925,7 @@ static void Prepare(vout_display_t *vd, picture_t *picture,
if (sys->d3dregions[i])
{
d3d_quad_t *quad = (d3d_quad_t *) sys->d3dregions[i]->p_sys;
- D3D11_RenderQuad(&sys->d3d_dev, quad, &sys->flatVShader, quad->picSys.renderSrc, sys->swapchainTargetView);
+ DisplayPicture(sys, quad, &sys->flatVShader, quad->picSys.renderSrc);
}
}
}
@@ -935,6 +936,19 @@ static void Prepare(vout_display_t *vd, picture_t *picture,
d3d11_device_unlock( &sys->d3d_dev );
}
+static void Prepare(vout_display_t *vd, picture_t *picture,
+ subpicture_t *subpicture, vlc_tick_t date)
+{
+ vout_display_sys_t *sys = vd->sys;
+
+ Manage(vd);
+ VLC_UNUSED(date);
+
+ D3D11_ClearRenderTargets( &sys->d3d_dev, sys->display.pixelFormat, sys->swapchainTargetView );
+
+ PreparePicture(vd, picture, subpicture);
+}
+
static void Display(vout_display_t *vd, picture_t *picture, subpicture_t *subpicture)
{
vout_display_sys_t *sys = vd->sys;
More information about the vlc-commits
mailing list