[vlc-commits] d3d11_quad: allow NULL render targets in D3D11_RenderQuad()

Steve Lhomme git at videolan.org
Tue Nov 20 09:18:16 CET 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Nov 19 14:29:17 2018 +0100| [c652e44489f564799ebdd4728de18b8b76680f23] | committer: Steve Lhomme

d3d11_quad: allow NULL render targets in D3D11_RenderQuad()

In case the OMSetRenderTargets() is done elsewhere in the code.

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

 modules/video_output/win32/d3d11_quad.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/win32/d3d11_quad.c b/modules/video_output/win32/d3d11_quad.c
index 6a61f8a705..c95bf1c71b 100644
--- a/modules/video_output/win32/d3d11_quad.c
+++ b/modules/video_output/win32/d3d11_quad.c
@@ -69,14 +69,16 @@ void D3D11_RenderQuad(d3d11_device_t *d3d_dev, d3d_quad_t *quad, d3d_vshader_t *
 
     for (size_t i=0; i<D3D11_MAX_SHADER_VIEW; i++)
     {
-        if (!d3drenderTargetView[i])
+        if (!quad->d3dpixelShader[i])
             break;
 
         ID3D11DeviceContext_PSSetShader(d3d_dev->d3dcontext, quad->d3dpixelShader[i], NULL, 0);
 
         ID3D11DeviceContext_RSSetViewports(d3d_dev->d3dcontext, 1, &quad->cropViewport[i]);
 
-        ID3D11DeviceContext_OMSetRenderTargets(d3d_dev->d3dcontext, 1, &d3drenderTargetView[i], NULL);
+        if (d3drenderTargetView[0])
+            /* TODO: handle outside selection of the render sub-target */
+            ID3D11DeviceContext_OMSetRenderTargets(d3d_dev->d3dcontext, 1, &d3drenderTargetView[i], NULL);
 
         ID3D11DeviceContext_DrawIndexed(d3d_dev->d3dcontext, quad->indexCount, 0, 0);
     }



More information about the vlc-commits mailing list