[vlc-commits] direct3d11: don't use the flip model before Win8.1
Steve Lhomme
git at videolan.org
Mon Oct 15 14:29:16 CEST 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Oct 15 13:07:30 2018 +0200| [e544360e0bd57bc1d979d260b1ad2098331f1fc1] | committer: Steve Lhomme
direct3d11: don't use the flip model before Win8.1
It's supported but Win7 can still use the d3d11 output.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e544360e0bd57bc1d979d260b1ad2098331f1fc1
---
modules/video_output/win32/direct3d11.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index d5c4f17fa7..19013eae60 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -504,7 +504,19 @@ static void FillSwapChainDesc(vout_display_t *vd, DXGI_SWAP_CHAIN_DESC1 *out)
if (isWin10OrGreater)
out->SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD;
else
- out->SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
+ {
+ bool isWin81OrGreater = false;
+ HMODULE hKernel32 = GetModuleHandle(TEXT("kernel32.dll"));
+ if (likely(hKernel32 != NULL))
+ isWin81OrGreater = GetProcAddress(hKernel32, "IsProcessCritical") != NULL;
+ if (isWin81OrGreater)
+ out->SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
+ else
+ {
+ out->SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
+ out->BufferCount = 1;
+ }
+ }
}
#endif
More information about the vlc-commits
mailing list