[vlc-devel] [PATCH 19/29] direct3d11: pass the shader resource view to DisplayD3DPicture()
Steve Lhomme
robux4 at videolabs.io
Thu Jan 19 11:10:54 CET 2017
For when it won't come from the quad anymore.
---
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 27bb51e..4f3f404 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -994,7 +994,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;
@@ -1012,7 +1012,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);
@@ -1043,13 +1043,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);
+ }
}
}
--
2.10.2
More information about the vlc-devel
mailing list