mirror of
https://github.com/libretro/RetroArch
synced 2025-01-31 06:32:48 +00:00
Merge pull request #7837 from krzys-h/uwp
Bugfixes to #7235 - creating swap chain twice in d3d11 and HOME path problems
This commit is contained in:
commit
50fcf4c190
@ -23,6 +23,39 @@
|
|||||||
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
|
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
|
||||||
#include <dynamic/dylib.h>
|
#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(
|
HRESULT WINAPI D3D11CreateDeviceAndSwapChain(
|
||||||
IDXGIAdapter* pAdapter,
|
IDXGIAdapter* pAdapter,
|
||||||
D3D_DRIVER_TYPE DriverType,
|
D3D_DRIVER_TYPE DriverType,
|
||||||
|
@ -687,20 +687,11 @@ d3d11_gfx_init(const video_info_t* video, const input_driver_t** input, void** i
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if defined(__WINRT__)
|
|
||||||
if (FAILED(D3D11CreateDevice(
|
if (FAILED(D3D11CreateDevice(
|
||||||
NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, flags,
|
NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, flags,
|
||||||
requested_feature_levels, number_feature_levels,
|
requested_feature_levels, number_feature_levels,
|
||||||
D3D11_SDK_VERSION, &d3d11->device,
|
D3D11_SDK_VERSION, &d3d11->device,
|
||||||
&d3d11->supportedFeatureLevel, &d3d11->context)))
|
&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;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1028,29 +1028,12 @@ void fill_pathname_expand_special(char *out_path,
|
|||||||
out_path += src_size;
|
out_path += src_size;
|
||||||
size -= src_size;
|
size -= src_size;
|
||||||
|
|
||||||
if (
|
|
||||||
(in_path[1] == '/')
|
|
||||||
#ifdef _WIN32
|
|
||||||
|| (in_path[1] == '\\')
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
{
|
|
||||||
in_path += 2;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
in_path++;
|
in_path++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free(home_dir);
|
||||||
}
|
}
|
||||||
}
|
else if (in_path[0] == ':')
|
||||||
else if ((in_path[0] == ':') &&
|
|
||||||
(
|
|
||||||
(in_path[1] == '/')
|
|
||||||
#ifdef _WIN32
|
|
||||||
|| (in_path[1] == '\\')
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
char *application_dir = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
char *application_dir = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||||
|
|
||||||
@ -1064,12 +1047,13 @@ void fill_pathname_expand_special(char *out_path,
|
|||||||
size_t src_size = strlcpy(out_path, application_dir, size);
|
size_t src_size = strlcpy(out_path, application_dir, size);
|
||||||
retro_assert(src_size < size);
|
retro_assert(src_size < size);
|
||||||
|
|
||||||
free(application_dir);
|
|
||||||
|
|
||||||
out_path += src_size;
|
out_path += src_size;
|
||||||
size -= src_size;
|
size -= src_size;
|
||||||
in_path += 2;
|
|
||||||
|
in_path++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free(application_dir);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user