mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Bugfix - creating swap chain twice in d3d11
Not sure what I was thinking when writing this
dd60b5d576 (commitcomment-31801518)
This commit is contained in:
parent
bddcd2d5e5
commit
1cb1ea55b1
@ -23,6 +23,39 @@
|
||||
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
|
||||
#include <dynamic/dylib.h>
|
||||
|
||||
HRESULT WINAPI D3D11CreateDevice(
|
||||
IDXGIAdapter* pAdapter,
|
||||
D3D_DRIVER_TYPE DriverType,
|
||||
HMODULE Software,
|
||||
UINT Flags,
|
||||
CONST D3D_FEATURE_LEVEL* pFeatureLevels,
|
||||
UINT FeatureLevels,
|
||||
UINT SDKVersion,
|
||||
ID3D11Device** ppDevice,
|
||||
D3D_FEATURE_LEVEL* pFeatureLevel,
|
||||
ID3D11DeviceContext** ppImmediateContext)
|
||||
{
|
||||
static dylib_t d3d11_dll;
|
||||
static PFN_D3D11_CREATE_DEVICE fp;
|
||||
|
||||
if (!d3d11_dll)
|
||||
d3d11_dll = dylib_load("d3d11.dll");
|
||||
|
||||
if (!d3d11_dll)
|
||||
return TYPE_E_CANTLOADLIBRARY;
|
||||
|
||||
if (!fp)
|
||||
fp = (PFN_D3D11_CREATE_DEVICE)dylib_proc(
|
||||
d3d11_dll, "D3D11CreateDevice");
|
||||
|
||||
if (!fp)
|
||||
return TYPE_E_DLLFUNCTIONNOTFOUND;
|
||||
|
||||
return fp(
|
||||
pAdapter, DriverType, Software, Flags, pFeatureLevels, FeatureLevels, SDKVersion,
|
||||
ppDevice, pFeatureLevel, ppImmediateContext);
|
||||
}
|
||||
|
||||
HRESULT WINAPI D3D11CreateDeviceAndSwapChain(
|
||||
IDXGIAdapter* pAdapter,
|
||||
D3D_DRIVER_TYPE DriverType,
|
||||
|
@ -687,20 +687,11 @@ d3d11_gfx_init(const video_info_t* video, const input_driver_t** input, void** i
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(__WINRT__)
|
||||
if (FAILED(D3D11CreateDevice(
|
||||
NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, flags,
|
||||
requested_feature_levels, number_feature_levels,
|
||||
D3D11_SDK_VERSION, &d3d11->device,
|
||||
&d3d11->supportedFeatureLevel, &d3d11->context)))
|
||||
#else
|
||||
if (FAILED(D3D11CreateDeviceAndSwapChain(
|
||||
NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, flags,
|
||||
requested_feature_levels, number_feature_levels,
|
||||
D3D11_SDK_VERSION, &desc,
|
||||
(IDXGISwapChain**)&d3d11->swapChain, &d3d11->device,
|
||||
&d3d11->supportedFeatureLevel, &d3d11->context)))
|
||||
#endif
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user