[vlc-commits] direct3d11: make sure we update the quad position of the region after texture reuse

Steve Lhomme git at videolan.org
Fri Apr 13 13:01:23 CEST 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Apr 13 12:28:13 2018 +0200| [68e4f6208890ebae366b9b254afd2511d737860a] | committer: Hugo Beauzée-Luyssen

direct3d11: make sure we update the quad position of the region after texture reuse

(cherry picked from commit edb7df81300b291e34d30637e94d3a65b330c5ee)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=68e4f6208890ebae366b9b254afd2511d737860a
---

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

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index d2b6d63398..49c2bc048b 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -3099,6 +3099,12 @@ static int Direct3D11MapSubpicture(vout_display_t *vd, int *subpicture_region_co
             }
         }
 
+        RECT output;
+        output.left   = r->fmt.i_x_offset;
+        output.right  = r->fmt.i_x_offset + r->fmt.i_visible_width;
+        output.top    = r->fmt.i_y_offset;
+        output.bottom = r->fmt.i_y_offset + r->fmt.i_visible_height;
+
         picture_t *quad_picture = (*region)[i];
         if (quad_picture == NULL) {
             d3d_quad_t *d3dquad = calloc(1, sizeof(*d3dquad));
@@ -3126,11 +3132,6 @@ static int Direct3D11MapSubpicture(vout_display_t *vd, int *subpicture_region_co
             }
             d3dquad->i_width    = r->fmt.i_width;
             d3dquad->i_height   = r->fmt.i_height;
-            RECT output;
-            output.left   = r->fmt.i_x_offset;
-            output.right  = r->fmt.i_x_offset + r->fmt.i_visible_width;
-            output.top    = r->fmt.i_y_offset;
-            output.bottom = r->fmt.i_y_offset + r->fmt.i_visible_height;
 
             err = SetupQuad( vd, &r->fmt, d3dquad, &output,
                              sys->d3dregion_format, sys->pSPUPixelShader,
@@ -3153,6 +3154,8 @@ static int Direct3D11MapSubpicture(vout_display_t *vd, int *subpicture_region_co
                 continue;
             }
             quad_picture = (*region)[i];
+        } else {
+            UpdateQuadPosition(vd, (d3d_quad_t *) quad_picture->p_sys, &output, PROJECTION_MODE_RECTANGULAR, ORIENT_NORMAL);
         }
 
         hr = ID3D11DeviceContext_Map(sys->d3d_dev.d3dcontext, ((d3d_quad_t *) quad_picture->p_sys)->picSys.resource[KNOWN_DXGI_INDEX], 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);



More information about the vlc-commits mailing list