diff options
author | wm4 <wm4@nowhere> | 2017-06-30 12:46:12 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-06-30 18:57:37 +0200 |
commit | f003d8ea367f247e3ff49b672003817a0c3cdb30 (patch) | |
tree | ff198c9ec228a30d226edadfd741956a9a24af70 /video/decode/d3d.c | |
parent | dd408e68ed57fa5130bef976751e58a5d6e42f75 (diff) | |
download | mpv-f003d8ea367f247e3ff49b672003817a0c3cdb30.tar.bz2 mpv-f003d8ea367f247e3ff49b672003817a0c3cdb30.tar.xz |
d3d: UWP support for D3D11VA
For some braindead reason, Microsoft decided to prevent you from
dynamically loading system libraries. This makes portability harder.
And we're talking about portability between Microsoft OSes!
Diffstat (limited to 'video/decode/d3d.c')
-rw-r--r-- | video/decode/d3d.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/video/decode/d3d.c b/video/decode/d3d.c index 3e6e1accc8..36d914d545 100644 --- a/video/decode/d3d.c +++ b/video/decode/d3d.c @@ -107,15 +107,29 @@ static const struct d3dva_mode d3dva_modes[] = { #endif HMODULE d3d11_dll, d3d9_dll, dxva2_dll; +PFN_D3D11_CREATE_DEVICE d3d11_D3D11CreateDevice; static pthread_once_t d3d_load_once = PTHREAD_ONCE_INIT; +#if !HAVE_UWP static void d3d_do_load(void) { d3d11_dll = LoadLibrary(L"d3d11.dll"); d3d9_dll = LoadLibrary(L"d3d9.dll"); dxva2_dll = LoadLibrary(L"dxva2.dll"); + + if (d3d11_dll) { + d3d11_D3D11CreateDevice = + (void *)GetProcAddress(d3d11_dll, "D3D11CreateDevice"); + } } +#else +static void d3d_do_load(void) +{ + + d3d11_D3D11CreateDevice = D3D11CreateDevice; +} +#endif void d3d_load_dlls(void) { |