Skip to content

Commit

Permalink
FidelityFX FSR v1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
rys committed Nov 15, 2021
1 parent bcffc81 commit a21ffb8
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 29 deletions.
Binary file modified docs/FidelityFX-FSR-Overview-Integration.pdf
Binary file not shown.
36 changes: 18 additions & 18 deletions ffx-fsr/ffx_fsr1.h
Original file line number Diff line number Diff line change
Expand Up @@ -747,12 +747,12 @@ AF1 sharpness){
// Immediate constants for peak range.
AF2 peakC=AF2(1.0,-1.0*4.0);
// Limiters, these need to be high precision RCPs.
AF1 hitMinR=mn4R*ARcpF1(AF1_(4.0)*mx4R);
AF1 hitMinG=mn4G*ARcpF1(AF1_(4.0)*mx4G);
AF1 hitMinB=mn4B*ARcpF1(AF1_(4.0)*mx4B);
AF1 hitMaxR=(peakC.x-mx4R)*ARcpF1(AF1_(4.0)*mn4R+peakC.y);
AF1 hitMaxG=(peakC.x-mx4G)*ARcpF1(AF1_(4.0)*mn4G+peakC.y);
AF1 hitMaxB=(peakC.x-mx4B)*ARcpF1(AF1_(4.0)*mn4B+peakC.y);
AF1 hitMinR=min(mn4R,eR)*ARcpF1(AF1_(4.0)*mx4R);
AF1 hitMinG=min(mn4G,eG)*ARcpF1(AF1_(4.0)*mx4G);
AF1 hitMinB=min(mn4B,eB)*ARcpF1(AF1_(4.0)*mx4B);
AF1 hitMaxR=(peakC.x-max(mx4R,eR))*ARcpF1(AF1_(4.0)*mn4R+peakC.y);
AF1 hitMaxG=(peakC.x-max(mx4G,eG))*ARcpF1(AF1_(4.0)*mn4G+peakC.y);
AF1 hitMaxB=(peakC.x-max(mx4B,eB))*ARcpF1(AF1_(4.0)*mn4B+peakC.y);
AF1 lobeR=max(-hitMinR,hitMaxR);
AF1 lobeG=max(-hitMinG,hitMaxG);
AF1 lobeB=max(-hitMinB,hitMaxB);
Expand Down Expand Up @@ -845,12 +845,12 @@ AF1 sharpness){
// Immediate constants for peak range.
AH2 peakC=AH2(1.0,-1.0*4.0);
// Limiters, these need to be high precision RCPs.
AH1 hitMinR=mn4R*ARcpH1(AH1_(4.0)*mx4R);
AH1 hitMinG=mn4G*ARcpH1(AH1_(4.0)*mx4G);
AH1 hitMinB=mn4B*ARcpH1(AH1_(4.0)*mx4B);
AH1 hitMaxR=(peakC.x-mx4R)*ARcpH1(AH1_(4.0)*mn4R+peakC.y);
AH1 hitMaxG=(peakC.x-mx4G)*ARcpH1(AH1_(4.0)*mn4G+peakC.y);
AH1 hitMaxB=(peakC.x-mx4B)*ARcpH1(AH1_(4.0)*mn4B+peakC.y);
AH1 hitMinR=min(mn4R,eR)*ARcpH1(AH1_(4.0)*mx4R);
AH1 hitMinG=min(mn4G,eG)*ARcpH1(AH1_(4.0)*mx4G);
AH1 hitMinB=min(mn4B,eB)*ARcpH1(AH1_(4.0)*mx4B);
AH1 hitMaxR=(peakC.x-max(mx4R,eR))*ARcpH1(AH1_(4.0)*mn4R+peakC.y);
AH1 hitMaxG=(peakC.x-max(mx4G,eG))*ARcpH1(AH1_(4.0)*mn4G+peakC.y);
AH1 hitMaxB=(peakC.x-max(mx4B,eB))*ARcpH1(AH1_(4.0)*mn4B+peakC.y);
AH1 lobeR=max(-hitMinR,hitMaxR);
AH1 lobeG=max(-hitMinG,hitMaxG);
AH1 lobeB=max(-hitMinB,hitMaxB);
Expand Down Expand Up @@ -963,12 +963,12 @@ AF1 sharpness){
// Immediate constants for peak range.
AH2 peakC=AH2(1.0,-1.0*4.0);
// Limiters, these need to be high precision RCPs.
AH2 hitMinR=mn4R*ARcpH2(AH2_(4.0)*mx4R);
AH2 hitMinG=mn4G*ARcpH2(AH2_(4.0)*mx4G);
AH2 hitMinB=mn4B*ARcpH2(AH2_(4.0)*mx4B);
AH2 hitMaxR=(peakC.x-mx4R)*ARcpH2(AH2_(4.0)*mn4R+peakC.y);
AH2 hitMaxG=(peakC.x-mx4G)*ARcpH2(AH2_(4.0)*mn4G+peakC.y);
AH2 hitMaxB=(peakC.x-mx4B)*ARcpH2(AH2_(4.0)*mn4B+peakC.y);
AH2 hitMinR=min(mn4R,eR)*ARcpH2(AH2_(4.0)*mx4R);
AH2 hitMinG=min(mn4G,eG)*ARcpH2(AH2_(4.0)*mx4G);
AH2 hitMinB=min(mn4B,eB)*ARcpH2(AH2_(4.0)*mx4B);
AH2 hitMaxR=(peakC.x-max(mx4R,eR))*ARcpH2(AH2_(4.0)*mn4R+peakC.y);
AH2 hitMaxG=(peakC.x-max(mx4G,eG))*ARcpH2(AH2_(4.0)*mn4G+peakC.y);
AH2 hitMaxB=(peakC.x-max(mx4B,eB))*ARcpH2(AH2_(4.0)*mn4B+peakC.y);
AH2 lobeR=max(-hitMinR,hitMaxR);
AH2 lobeG=max(-hitMinG,hitMaxG);
AH2 lobeB=max(-hitMinB,hitMaxB);
Expand Down
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ To build the FSR sample, please follow the following instructions:
1) Install the following tools:

- [CMake 3.16](https://cmake.org/download/)
- Install the "Desktop Development with C++" workload
- [Visual Studio 2019](https://visualstudio.microsoft.com/downloads/)
- [Windows 10 SDK 10.0.18362.0](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk)
- [Git 2.32.0](https://git-scm.com/downloads)

2) Generate the solutions:
```
Expand Down
10 changes: 5 additions & 5 deletions sample/src/DX12/FSRSample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ FSRSample::FSRSample(LPCSTR name) : FrameworkWindows(name)
m_bPlay = true;

m_pGltfLoader = NULL;
mipBias[0] = -0.3f;
mipBias[1] = -0.5f;
mipBias[2] = -0.7f;
mipBias[0] = -0.38f;
mipBias[1] = -0.585f;
mipBias[2] = -0.75f;
mipBias[3] = -1.0f;
mipBias[4] = 0.0f;
}
Expand Down Expand Up @@ -692,7 +692,7 @@ void FSRSample::BuildUI()
m_swapChain.SetVSync(m_VsyncEnabled);
ImGui::Spacing();
ImGui::Spacing();
const char* fullscreenModes[] = { "Windowed", "BorderlessFullscreen", "ExclusiveFulscreen" };
const char* fullscreenModes[] = { "Windowed", "BorderlessFullscreen", "ExclusiveFullscreen" };
if (ImGui::Combo("Fullscreen Mode", (int*)&m_fullscreenMode, fullscreenModes, _countof(fullscreenModes)))
{
if (m_previousFullscreenMode != m_fullscreenMode)
Expand Down Expand Up @@ -917,7 +917,7 @@ int WINAPI WinMain(HINSTANCE hInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
LPCSTR Name = "FidelityFX Super Resolution 1.0";
LPCSTR Name = "FidelityFX Super Resolution 1.0.2";

// create new DX sample
return RunFramework(hInstance, lpCmdLine, nCmdShow, new FSRSample(Name));
Expand Down
10 changes: 5 additions & 5 deletions sample/src/VK/FSRSample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ FSRSample::FSRSample(LPCSTR name) : FrameworkWindows(name)
m_bPlay = true;

m_pGltfLoader = NULL;
mipBias[0] = -0.3f;
mipBias[1] = -0.5f;
mipBias[2] = -0.7f;
mipBias[0] = -0.38f;
mipBias[1] = -0.585f;
mipBias[2] = -0.75f;
mipBias[3] = -1.0f;
mipBias[4] = 0.0f;
}
Expand Down Expand Up @@ -718,7 +718,7 @@ void FSRSample::BuildUI()
}
ImGui::Spacing();
ImGui::Spacing();
const char* fullscreenModes[] = { "Windowed", "BorderlessFullscreen", "ExclusiveFulscreen" };
const char* fullscreenModes[] = { "Windowed", "BorderlessFullscreen", "ExclusiveFullscreen" };
if (ImGui::Combo("Fullscreen Mode", (int*)&m_fullscreenMode, fullscreenModes, _countof(fullscreenModes)))
{
if (m_previousFullscreenMode != m_fullscreenMode)
Expand Down Expand Up @@ -945,7 +945,7 @@ int WINAPI WinMain(HINSTANCE hInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
LPCSTR Name = "FidelityFX Super Resolution 1.0";
LPCSTR Name = "FidelityFX Super Resolution 1.0.2";

// create new Vulkan sample
return RunFramework(hInstance, lpCmdLine, nCmdShow, new FSRSample(Name));
Expand Down
2 changes: 1 addition & 1 deletion sample/src/VK/FSR_Pass.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
#endif
#if SAMPLE_RCAS
#define FSR_RCAS_H
AH4 FsrRcasLoadH(ASW2 p) { return InputTexture.Load(ASW3(ASW2(p), 0)); }
AH4 FsrRcasLoadH(ASW2 p) { return (AH4)InputTexture.Load(ASW3(ASW2(p), 0)); }
void FsrRcasInputH(inout AH1 r,inout AH1 g,inout AH1 b){}
#endif
#endif
Expand Down

0 comments on commit a21ffb8

Please sign in to comment.