Skip to content

Instantly share code, notes, and snippets.

@Riesi
Last active March 18, 2019 17:29
Show Gist options
  • Save Riesi/09babd6f06908dbe48ff114bdbbee39b to your computer and use it in GitHub Desktop.
Save Riesi/09babd6f06908dbe48ff114bdbbee39b to your computer and use it in GitHub Desktop.
Potential Reshade fix
diff --git a/src/d3d11/d3d11_main.cpp b/src/d3d11/d3d11_main.cpp
index 4ab16ca..f5a2a4b 100644
--- a/src/d3d11/d3d11_main.cpp
+++ b/src/d3d11/d3d11_main.cpp
@@ -97,8 +97,7 @@ extern "C" {
}
}
-
- DLLEXPORT HRESULT __stdcall D3D11CreateDevice(
+ static HRESULT D3D11CreateDevice_w(
IDXGIAdapter* pAdapter,
D3D_DRIVER_TYPE DriverType,
HMODULE Software,
@@ -178,6 +177,22 @@ extern "C" {
return S_OK;
}
+ DLLEXPORT HRESULT __stdcall 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) {
+
+ return D3D11CreateDevice_w(pAdapter, DriverType,
+ Software, Flags, pFeatureLevels, FeatureLevels,
+ SDKVersion, ppDevice, pFeatureLevel, ppImmediateContext);
+}
DLLEXPORT HRESULT __stdcall D3D11CreateDeviceAndSwapChain(
IDXGIAdapter* pAdapter,
@@ -203,7 +218,7 @@ extern "C" {
return E_INVALIDARG;
// Try to create a device first.
- HRESULT status = D3D11CreateDevice(pAdapter, DriverType,
+ HRESULT status = D3D11CreateDevice_w(pAdapter, DriverType,
Software, Flags, pFeatureLevels, FeatureLevels,
SDKVersion, &d3d11Device, pFeatureLevel, &d3d11Context);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment