Skip to content

Commit 83f167d

Browse files
[d3d11] Load Intel vendor hack DLL
1 parent 6c7162f commit 83f167d

2 files changed

Lines changed: 37 additions & 5 deletions

File tree

‎src/d3d11/d3d11_device.cpp‎

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3764,6 +3764,30 @@ namespace dxvk {
37643764

37653765

37663766

3767+
HMODULE D3D11DXGIDevice::initVendorHacks() {
3768+
#ifdef _WIN32
3769+
if (m_dxvkAdapter->info().vendorId == uint32_t(DxvkGpuVendor::Intel)) {
3770+
char sysdir[MAX_PATH], path[MAX_PATH];
3771+
GetSystemDirectoryA(sysdir, sizeof(sysdir));
3772+
snprintf(path, sizeof(path),
3773+
"%s\\DriverStore\\FileRepository\\igd_faux.inf_1\\igd10iumd64.dll", sysdir);
3774+
HMODULE igd10iumd = ::LoadLibraryA(path);
3775+
if (igd10iumd)
3776+
Logger::info("Loaded igd10iumd64.dll for Intel driver workarounds");
3777+
return igd10iumd;
3778+
}
3779+
#endif
3780+
return nullptr;
3781+
}
3782+
3783+
void D3D11DXGIDevice::cleanupVendorHacks() {
3784+
#ifdef _WIN32
3785+
if (m_vendorHacks.igd10iumd64)
3786+
::FreeLibrary(m_vendorHacks.igd10iumd64);
3787+
#endif
3788+
}
3789+
3790+
37673791
D3D11DXGIDevice::D3D11DXGIDevice(
37683792
IDXGIAdapter* pAdapter,
37693793
ID3D12Device* pD3D12Device,
@@ -3786,12 +3810,12 @@ namespace dxvk {
37863810
m_metaDevice (this),
37873811
m_dxvkFactory (this, &m_d3d11Device),
37883812
m_destructionNotifier(this) {
3789-
3813+
m_vendorHacks.igd10iumd64 = initVendorHacks();
37903814
}
3791-
3792-
3793-
D3D11DXGIDevice::~D3D11DXGIDevice() {
37943815

3816+
3817+
D3D11DXGIDevice::~D3D11DXGIDevice() {
3818+
cleanupVendorHacks();
37953819
}
37963820

37973821

‎src/d3d11/d3d11_device.h‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,9 +1012,17 @@ namespace dxvk {
10121012
DXGIVkSwapChainFactory m_dxvkFactory;
10131013

10141014
D3DDestructionNotifier m_destructionNotifier;
1015-
1015+
1016+
struct {
1017+
HMODULE igd10iumd64 = nullptr;
1018+
} m_vendorHacks;
1019+
10161020
uint32_t m_frameLatency = DefaultFrameLatency;
10171021

1022+
HMODULE initVendorHacks();
1023+
1024+
void cleanupVendorHacks();
1025+
10181026
};
10191027

10201028
}

0 commit comments

Comments
 (0)