Recompiling AMD's FSR2 plugin for linux

Has anyone had any success recompiling this for Linux? On UE 4.27, the built in Clang 11 compiler only throws up 18 errors on /ffx-fsr2-api/ffx_fsr2.cpp and 2 errors on /ffx-fsr2-api/vk/ffx_fsr2_vk.cpp.
I reduced ffx_fsr2.cpp’s 18 errors down to 4 by replacing every wscpy_s with a wscpy.

Here’s the problem code in ffx_fsr2.cpp. No matter how I rearrange it, it keeps saying the {} brackets are in the wrong place.

    const float matrix_elem_c[2][2] = {
        {{fQ,}}                     // non reversed, non infinite
        -1.0f - FLT_EPSILON,    // non reversed, infinite
        {{fQ,}}                     // reversed, non infinite
        0.0f + FLT_EPSILON      // reversed, infinite
    };

    const float matrix_elem_e[2][2] = {
        {{fQ * fMin,}}             // non reversed, non infinite
        -fMin - FLT_EPSILON,    // non reversed, infinite
        {{fQ * fMin,}}             // reversed, non infinite
        fMax,                  // reversed, infinite
    };

The other problem is "Source/ffx-fsr2-api/vk/ffx_fsr2_vk.cpp:1329:5: error: no template named ‘wstring_convert’ in namespace ‘std’; did you mean ‘TStringConvert’?

std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;

So I tried TStringConvert instead of std::wstring_convert and clang had no idea what I was talking about. (Hell, I had no idea what I was trying to tell it either!)
“error: too few template arguments for class template ‘TStringConvert’
TStringConvert<std::codecvt_utf8_utf16<wchar_t>> converter;”

Not knowing a lot about C++ doesn’t help. Being on vsCode without intellisense doesn’t help either. From what I understand, the clang and gcc compilers handle certain commands differently from windows compilers. If someone could help me fix these 2 errors, I can build FSR 2 for Linux! Thanks in advance!

1 Like

me too

I try change to this can solve this issue:

    const float matrix_elem_c[2][2] = {
        {fQ,                     // non reversed, non infinite
        -1.0f - FLT_EPSILON},    // non reversed, infinite
        {fQ,                     // reversed, non infinite
        0.0f + FLT_EPSILON}      // reversed, infinite
    };
    const float matrix_elem_e[2][2] = {
        {fQ * fMin,             // non reversed, non infinite
        -fMin - FLT_EPSILON},    // non reversed, infinite
        {fQ * fMin,             // reversed, non infinite
        fMax}                  // reversed, infinite
    };

but I have other issue

Has anyone been able to compile this plugin on the Linux Side. I’m on 5.1.1 trying fsr 2.2.1b and got most of the errors cleaned up to a point. This is my current error type that keeps it from completing the build of the plugin.

ld.lld: error: undefined symbol: ffxFsr2GetUpscaleRatioFromQualityMode
>>> referenced by FSR2TemporalUpscaler.cpp:704 (./../Plugins/Marketplace/FSR2/Source/FSR2TemporalUpscaling/Private/FSR2TemporalUpscaler.cpp:704)
>>>               /home/darkhemic/Documents/Apps/UnrealEngine-5.1.1-fsr/Engine/Plugins/Marketplace/FSR2/Intermediate/Build/Linux/B4D820EA/UnrealEditor/Development/FSR2TemporalUpscaling/Module.FSR2TemporalUpscaling.cpp.o:(FFSR2TemporalUpscaler::UpdateScreenPercentage())

Any help would be great.