PotatoOfDoom / CyberFSR2

FidelityFx Super Resolution 2.0 for Cyberpunk
MIT License
615 stars 66 forks source link

RoTTR #32

Closed nikviktorovich closed 1 year ago

nikviktorovich commented 1 year ago

In addition to the GPU check, RoTTR checks for D3D11 DLSS support as well (regardless of chosen graphics API). Basically, it checks if D3D11 DLSS functions exist, gets parameters from GetParameters and shuts down DLSS. So stub functions for Init, GetParameters and Shutdown is enough (unfortunately, I couldn't find a better way to bypass this check). While Init and Shutdown functions can just return success, GetParameters has to create the parameters object, since the game tries to get some parameters and otherwise there will be an exception. So the file CyberFsrDx11.cpp (or you can choose any other name, it doesn't matter) may look like this:

#include "pch.h"
#include "CyberFsr.h"

NVSDK_NGX_Result NVSDK_NGX_D3D11_Init(void)
{
    return NVSDK_NGX_Result_Success;
}

// Function parameters omitted
NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_Shutdown(void)
{
    return NVSDK_NGX_Result_Success;
}

NVSDK_NGX_Result NVSDK_NGX_D3D11_GetParameters(NVSDK_NGX_Parameter** OutParameters)
{
    *OutParameters = CyberFsrContext::instance()->AllocateParameter();
    return NVSDK_NGX_Result_Success;
}

To bypass checking for other D3D11 DLSS functions, address 0xCE0768 needs to be patched with 00 00 which basically allows to return success in case of error. Bypassing GPU check can be done by patching 0xC846D8 with EB.

Game version: v1.0 build 1027.0_64 from EG

Calinou commented 1 year ago

https://github.com/PotatoOfDoom/CyberFSR2/pull/40 has been merged, should this issue be closed?