[vlc-commits] [Git][videolan/vlc][3.0.x] direct3d11: add the texture pointer to fake slices

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sat Sep 4 21:01:52 UTC 2021



Jean-Baptiste Kempf pushed to branch 3.0.x at VideoLAN / VLC


Commits:
5af494a1 by Steve Lhomme at 2021-09-04T20:37:28+00:00
direct3d11: add the texture pointer to fake slices

On NVIDIA and mobile/xbox we let the decoder allocate its own decoder pool
rather than using the one from the vout. But to check that the vout pool has
enough slices for the decoder, we need to have the ID3D11Texture2D used by the
display module.

So far only the real slices had the ID3D11Texture2D. Now we set it on all of
them in case all the good ones are in use, so that the decoder can still probe
what the decoder is using, even if it's not going to use that picture for
anything but probing the number of slices.

And we don't create shader resource view (SRV) for the fake slices.

All fake slices point to slice 0.

Fixes #26009

- - - - -


1 changed file:

- modules/video_output/win32/direct3d11.c


Changes:

=====================================
modules/video_output/win32/direct3d11.c
=====================================
@@ -414,9 +414,17 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned pool_size)
                 goto error;
 
             for (unsigned plane = 0; plane < D3D11_MAX_SHADER_VIEW; plane++)
-                picsys->texture[plane] = textures[picture_count * D3D11_MAX_SHADER_VIEW + plane];
+            {
+                if (picture_count < slices)
+                    picsys->texture[plane] =textures[picture_count * D3D11_MAX_SHADER_VIEW + plane];
+                else if (textures[plane])
+                {
+                    picsys->texture[plane] = textures[plane];
+                    ID3D11Texture2D_AddRef(picsys->texture[plane]);
+                }
+            }
 
-            picsys->slice_index = picture_count;
+            picsys->slice_index = picture_count < slices ? picture_count : 0;
             picsys->formatTexture = sys->picQuad.formatInfo->formatTexture;
             picsys->context = sys->d3d_dev.d3dcontext;
 
@@ -442,7 +450,7 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned pool_size)
 #endif
         {
             sys->picQuad.resourceCount = DxgiResourceCount(sys->picQuad.formatInfo);
-            for (picture_count = 0; picture_count < pool_size; picture_count++) {
+            for (picture_count = 0; picture_count < slices; picture_count++) {
                 if (!pictures[picture_count]->p_sys->texture[0])
                     continue;
                 if (D3D11_AllocateShaderView(vd, sys->d3d_dev.d3ddevice, sys->picQuad.formatInfo,



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/5af494a1d3d27c9f4ce04d10a481052545e52264

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/5af494a1d3d27c9f4ce04d10a481052545e52264
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list