Prevent FSR4update of custom FSR3.1 implementations

This commit is contained in:
cdozdil
2026-05-10 18:42:56 +02:00
committed by FakeMichau
parent 07787f1605
commit 5d09d40ff7
+11
View File
@@ -28,6 +28,8 @@
#undef FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_WAITCALLBACK
#undef FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_FRAMEPACINGTUNING
#pragma intrinsic(_ReturnAddress)
static HMODULE moduleAmdxc64 = nullptr;
static HMODULE moduleAmdxcffx64 = nullptr;
@@ -158,6 +160,15 @@ struct AmdExtFfxApi : public IAmdExtFfxApi
HRESULT STDMETHODCALLTYPE UpdateFfxApiProvider(void* pData, uint32_t dataSizeInBytes) override
{
auto returnAddress = _ReturnAddress();
auto callerModule = Util::GetCallerModule(returnAddress);
if (callerModule == exeModule)
{
LOG_WARN("Called from game module, returning E_NOINTERFACE");
return E_NOINTERFACE;
}
auto effectType = FfxApiProxy::GetType(reinterpret_cast<ExternalProviderData*>(pData)->descType);
auto effect = magic_enum::enum_name(effectType);