[vlc-devel] [PATCH 1/4] direct3d11: keep track of mapped surfaces
Steve Lhomme
robux4 at videolabs.io
Fri Feb 10 15:12:18 CET 2017
---
modules/video_chroma/d3d11_fmt.h | 1 +
modules/video_output/win32/direct3d11.c | 8 +++++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/modules/video_chroma/d3d11_fmt.h b/modules/video_chroma/d3d11_fmt.h
index caea919..dcffe35 100644
--- a/modules/video_chroma/d3d11_fmt.h
+++ b/modules/video_chroma/d3d11_fmt.h
@@ -40,6 +40,7 @@ struct picture_sys_t
ID3D11VideoProcessorInputView *inputView; /* when used as processor input */
ID3D11ShaderResourceView *resourceView[D3D11_MAX_SHADER_VIEW];
DXGI_FORMAT formatTexture;
+ bool mapped;
};
/* index to use for texture/resource that use a known DXGI format
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 301cdcc..9bab5a9 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -401,13 +401,19 @@ static int Direct3D11MapPoolTexture(picture_t *picture)
{
return VLC_EGENERIC;
}
+
+ p_sys->mapped = true;
+
return CommonUpdatePicture(picture, NULL, mappedResource.pData, mappedResource.RowPitch);
}
static void Direct3D11UnmapPoolTexture(picture_t *picture)
{
picture_sys_t *p_sys = picture->p_sys;
- ID3D11DeviceContext_Unmap(p_sys->context, p_sys->resource[KNOWN_DXGI_INDEX], 0);
+ if (p_sys->mapped) {
+ ID3D11DeviceContext_Unmap(p_sys->context, p_sys->resource[KNOWN_DXGI_INDEX], 0);
+ p_sys->mapped = true;
+ }
}
#if !VLC_WINSTORE_APP
--
2.10.2
More information about the vlc-devel
mailing list