[vlc-commits] d3d11_quad: reset the ShaderResources as soon as drawing with it is done
Steve Lhomme
git at videolan.org
Tue Nov 20 09:18:17 CET 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Nov 19 14:30:38 2018 +0100| [cf5e665e47762bc793b87088e7edc235d4b228d2] | committer: Steve Lhomme
d3d11_quad: reset the ShaderResources as soon as drawing with it is done
This may help with performance and avoid an issue when the render target is
also an input texture for another pipeline.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cf5e665e47762bc793b87088e7edc235d4b228d2
---
modules/video_output/win32/d3d11_quad.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/modules/video_output/win32/d3d11_quad.c b/modules/video_output/win32/d3d11_quad.c
index c95bf1c71b..894449ca7c 100644
--- a/modules/video_output/win32/d3d11_quad.c
+++ b/modules/video_output/win32/d3d11_quad.c
@@ -82,6 +82,11 @@ void D3D11_RenderQuad(d3d11_device_t *d3d_dev, d3d_quad_t *quad, d3d_vshader_t *
ID3D11DeviceContext_DrawIndexed(d3d_dev->d3dcontext, quad->indexCount, 0, 0);
}
+
+ /* force unbinding the input texture, otherwise we get:
+ * OMSetRenderTargets: Resource being set to OM RenderTarget slot 0 is still bound on input! */
+ ID3D11RenderTargetView *reset[D3D11_MAX_SHADER_VIEW] = { 0 };
+ ID3D11DeviceContext_PSSetShaderResources(d3d_dev->d3dcontext, 0, quad->resourceCount, reset);
}
static bool AllocQuadVertices(vlc_object_t *o, d3d11_device_t *d3d_dev, d3d_quad_t *quad, video_projection_mode_t projection)
More information about the vlc-commits
mailing list