mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-11-04 13:03:17 +00:00
Fix dxgi spoofing for amdxcffx64
This commit is contained in:
1 parent
455ab392fe
commit
8f2a943589
1 file changed
+6
-2
@@ -160,7 +160,11 @@ HRESULT DxgiSpoofing::hkGetDesc1(IDXGIAdapter1* This, DXGI_ADAPTER_DESC1* pDesc)
|
||||
auto targetDeviceIdMatches = !Config::Instance()->TargetDeviceId.has_value() ||
|
||||
Config::Instance()->TargetDeviceId.value() == pDesc->DeviceId;
|
||||
|
||||
if (pDesc->VendorId != VendorId::Microsoft && targetVendorIdMatches && targetDeviceIdMatches &&
|
||||
// amdxcffx64 needs to see AMD vendor id
|
||||
auto isFfxDriver = caller.starts_with("amdxcffx64");
|
||||
auto keepRealAmd = isFfxDriver && pDesc->VendorId == VendorId::AMD;
|
||||
|
||||
if (pDesc->VendorId != VendorId::Microsoft && targetVendorIdMatches && targetDeviceIdMatches && !keepRealAmd &&
|
||||
Config::Instance()->DxgiSpoofing.value_or_default() && !SkipSpoofing())
|
||||
{
|
||||
pDesc->VendorId = Config::Instance()->SpoofedVendorId.value_or_default();
|
||||
@@ -175,7 +179,7 @@ HRESULT DxgiSpoofing::hkGetDesc1(IDXGIAdapter1* This, DXGI_ADAPTER_DESC1* pDesc)
|
||||
#endif
|
||||
}
|
||||
|
||||
if (caller.starts_with("amdxcffx64") || caller.starts_with("amd_fidelityfx_upscaler_dx12"))
|
||||
if (isFfxDriver || caller.starts_with("amd_fidelityfx_upscaler_dx12"))
|
||||
{
|
||||
const auto primaryGpu = IdentifyGpu::getPrimaryGpu();
|
||||
|
||||
|
||||
Reference in new issue
Block a user