[vlc-commits] direct3d11: don't allow mapping opaque decoder textures to the CPU
Steve Lhomme
git at videolan.org
Wed Feb 8 14:46:02 CET 2017
vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Wed Feb 8 14:26:59 2017 +0100| [1b8a7861d2159bfc6fc5459f11a41abbb89006bc] | committer: Jean-Baptiste Kempf
direct3d11: don't allow mapping opaque decoder textures to the CPU
Since we're doing direct rendering it will never go into the CPU.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1b8a7861d2159bfc6fc5459f11a41abbb89006bc
---
modules/video_output/win32/direct3d11.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 72bbe76..e7eef8b 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -658,7 +658,15 @@ static int AllocateTextures(vout_display_t *vd, const d3d_format_t *cfg,
texDesc.Usage = D3D11_USAGE_DEFAULT;
texDesc.CPUAccessFlags = 0;
texDesc.Format = cfg->formatTexture;
- texDesc.BindFlags = D3D11_BIND_DECODER | D3D11_BIND_SHADER_RESOURCE;
+ texDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
+ if (is_d3d11_opaque(fmt->i_chroma)) {
+ texDesc.BindFlags |= D3D11_BIND_DECODER;
+ texDesc.Usage = D3D11_USAGE_DEFAULT;
+ texDesc.CPUAccessFlags = 0;
+ } else {
+ texDesc.Usage = D3D11_USAGE_DYNAMIC;
+ texDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
+ }
texDesc.ArraySize = pool_size;
texDesc.Height = fmt->i_height;
texDesc.Width = fmt->i_width;
More information about the vlc-commits
mailing list