[vlc-devel] [PATCH] direct3d11: only report leaks when there's a debugger
Hugo Beauzée-Luyssen
hugo at beauzee.fr
Wed Jul 19 10:44:10 CEST 2017
On Wed, Jul 19, 2017, at 10:38 AM, Steve Lhomme wrote:
> It seems plenty of people have issues with d3d11_1sdklayers.dll being
> present
> but not usable.
> If a dev has the issue he can always disable this code section for
> testing.
> ---
> modules/video_output/win32/direct3d11.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/modules/video_output/win32/direct3d11.c
> b/modules/video_output/win32/direct3d11.c
> index 9da636203f..19a2ac9a06 100644
> --- a/modules/video_output/win32/direct3d11.c
> +++ b/modules/video_output/win32/direct3d11.c
> @@ -1469,10 +1469,12 @@ static int Direct3D11Open(vout_display_t *vd,
> video_format_t *fmt)
> HRESULT hr = S_OK;
>
> # if !defined(NDEBUG)
> - HINSTANCE sdklayer_dll = LoadLibrary(TEXT("d3d11_1sdklayers.dll"));
> - if (sdklayer_dll) {
> - creationFlags |= D3D11_CREATE_DEVICE_DEBUG;
> - FreeLibrary(sdklayer_dll);
> + if (IsDebuggerPresent()) {
> + HINSTANCE sdklayer_dll =
> LoadLibrary(TEXT("d3d11_1sdklayers.dll"));
> + if (sdklayer_dll) {
> + creationFlags |= D3D11_CREATE_DEVICE_DEBUG;
> + FreeLibrary(sdklayer_dll);
> + }
> }
> # endif
>
> --
> 2.12.1
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
To my surprise, this is implemented in mingw-w64, however this won't
work for UWP builds:
#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
WINBASEAPI WINBOOL WINAPI IsDebuggerPresent (VOID);
--
Hugo Beauzée-Luyssen
hugo at beauzee.fr
More information about the vlc-devel
mailing list