[vlc-commits] direct3d11: allocate the SPU texture directly in the quad structure

Steve Lhomme git at videolan.org
Tue Feb 13 11:38:24 CET 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Feb 12 14:36:16 2018 +0100| [d7a56834b9a9617a2a113b34153a78ac628f39a5] | committer: Hugo Beauzée-Luyssen

direct3d11: allocate the SPU texture directly in the quad structure

(cherry picked from commit 28a0ae9f6ad49590c8058e20da97c5f7574077b3)
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=d7a56834b9a9617a2a113b34153a78ac628f39a5
---

 modules/video_output/win32/direct3d11.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index a5b35958b6..20783c26ff 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -2943,24 +2943,20 @@ static int Direct3D11MapSubpicture(vout_display_t *vd, int *subpicture_region_co
 
         picture_t *quad_picture = (*region)[i];
         if (quad_picture == NULL) {
-            ID3D11Texture2D *textures[D3D11_MAX_SHADER_VIEW] = {0};
             d3d_quad_t *d3dquad = calloc(1, sizeof(*d3dquad));
             if (unlikely(d3dquad==NULL)) {
                 continue;
             }
-            if (AllocateTextures(VLC_OBJECT(vd), &sys->d3d_dev, sys->d3dregion_format, &r->fmt, 1, textures)) {
+            if (AllocateTextures(VLC_OBJECT(vd), &sys->d3d_dev, sys->d3dregion_format, &r->fmt, 1, d3dquad->picSys.texture)) {
                 msg_Err(vd, "Failed to allocate %dx%d texture for OSD",
                         r->fmt.i_visible_width, r->fmt.i_visible_height);
                 for (int j=0; j<D3D11_MAX_SHADER_VIEW; j++)
-                    if (textures[j])
-                        ID3D11Texture2D_Release(textures[j]);
+                    if (d3dquad->picSys.texture[j])
+                        ID3D11Texture2D_Release(d3dquad->picSys.texture[j]);
                 free(d3dquad);
                 continue;
             }
 
-            for (unsigned plane = 0; plane < D3D11_MAX_SHADER_VIEW; plane++) {
-                d3dquad->picSys.texture[plane] = textures[plane];
-            }
             if (AllocateShaderView(VLC_OBJECT(vd), sys->d3d_dev.d3ddevice, sys->d3dregion_format,
                                    d3dquad->picSys.texture, 0,
                                    d3dquad->picSys.resourceView)) {



More information about the vlc-commits mailing list