[vlc-commits] direct3d11: pass the shader resource view to DisplayD3DPicture()

Steve Lhomme git at videolan.org
Thu Feb 2 17:01:10 CET 2017


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Thu Feb  2 14:54:07 2017 +0100| [6d09369f853b6111c236817ef512d7c973804be6] | committer: Jean-Baptiste Kempf

direct3d11: pass the shader resource view to DisplayD3DPicture()

For when it won't come from the quad anymore.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

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

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 1fbcdce..55f3d8a 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1075,7 +1075,7 @@ static void Prepare(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
     }
 }
 
-static void DisplayD3DPicture(vout_display_sys_t *sys, d3d_quad_t *quad)
+static void DisplayD3DPicture(vout_display_sys_t *sys, d3d_quad_t *quad, ID3D11ShaderResourceView *resourceView[2])
 {
     UINT stride = sizeof(d3d_vertex_t);
     UINT offset = 0;
@@ -1093,7 +1093,7 @@ static void DisplayD3DPicture(vout_display_sys_t *sys, d3d_quad_t *quad)
     ID3D11DeviceContext_PSSetShader(sys->d3dcontext, quad->d3dpixelShader, NULL, 0);
 
     ID3D11DeviceContext_PSSetConstantBuffers(sys->d3dcontext, 0, quad->PSConstantsCount, quad->pPixelShaderConstants);
-    ID3D11DeviceContext_PSSetShaderResources(sys->d3dcontext, 0, 2, &quad->picSys.resourceView[0]);
+    ID3D11DeviceContext_PSSetShaderResources(sys->d3dcontext, 0, 2, resourceView);
 
     ID3D11DeviceContext_RSSetViewports(sys->d3dcontext, 1, &quad->cropViewport);
 
@@ -1124,13 +1124,16 @@ static void Display(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
         Direct3D11UnmapTexture(picture);
 
     /* Render the quad */
-    DisplayD3DPicture(sys, &sys->picQuad);
+    DisplayD3DPicture(sys, &sys->picQuad, sys->picQuad.picSys.resourceView);
 
     if (subpicture) {
         // draw the additional vertices
         for (int i = 0; i < sys->d3dregion_count; ++i) {
             if (sys->d3dregions[i])
-                DisplayD3DPicture(sys, (d3d_quad_t *) sys->d3dregions[i]->p_sys);
+            {
+                d3d_quad_t *quad = (d3d_quad_t *) sys->d3dregions[i]->p_sys;
+                DisplayD3DPicture(sys, quad, quad->picSys.resourceView);
+            }
         }
     }
 



More information about the vlc-commits mailing list