[vlc-commits] direct3d11: copy the whole source to the staging texture

Steve Lhomme git at videolan.org
Mon Dec 18 10:39:27 CET 2017


vlc/vlc-3.0 | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Mon Dec 18 09:57:02 2017 +0100| [d19cf4d55213fb5a7622ed1c21add486a192cdd9] | committer: Jean-Baptiste Kempf

direct3d11: copy the whole source to the staging texture

Otherwise some areas with no copy may contain some green.

Fixes #19298 for older GPUs

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 9243000e2e19843c12245b80eac0ec0b46df31c3)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/video_output/win32/direct3d11.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 1b278b16e9..51c424adad 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1131,26 +1131,11 @@ static void Prepare(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
             if (!is_d3d11_opaque(picture->format.i_chroma))
                 Direct3D11UnmapPoolTexture(picture);
             ID3D11Texture2D_GetDesc(sys->stagingSys.texture[0], &texDesc);
-            D3D11_BOX box = {
-                .top = 0,
-                .bottom = picture->format.i_y_offset + picture->format.i_visible_height,
-                .left = 0,
-                .right = picture->format.i_x_offset + picture->format.i_visible_width,
-                .back = 1,
-            };
-            if ( sys->picQuadConfig->formatTexture != DXGI_FORMAT_R8G8B8A8_UNORM &&
-                 sys->picQuadConfig->formatTexture != DXGI_FORMAT_B5G6R5_UNORM )
-            {
-                box.bottom = (box.bottom + 0x01) & ~0x01;
-                box.right  = (box.right  + 0x01) & ~0x01;
-            }
-            assert(box.right <= texDesc.Width);
-            assert(box.bottom <= texDesc.Height);
             ID3D11DeviceContext_CopySubresourceRegion(sys->d3d_dev.d3dcontext,
                                                       sys->stagingSys.resource[KNOWN_DXGI_INDEX],
                                                       0, 0, 0, 0,
                                                       p_sys->resource[KNOWN_DXGI_INDEX],
-                                                      p_sys->slice_index, &box);
+                                                      p_sys->slice_index, NULL);
         }
         else
         {



More information about the vlc-commits mailing list