Skip to content

Commit a21ffb8

Browse files
committed
FidelityFX FSR v1.0.2
1 parent bcffc81 commit a21ffb8

File tree

6 files changed

+31
-29
lines changed

6 files changed

+31
-29
lines changed
-1.84 MB
Binary file not shown.

ffx-fsr/ffx_fsr1.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -747,12 +747,12 @@ AF1 sharpness){
747747
// Immediate constants for peak range.
748748
AF2 peakC=AF2(1.0,-1.0*4.0);
749749
// Limiters, these need to be high precision RCPs.
750-
AF1 hitMinR=mn4R*ARcpF1(AF1_(4.0)*mx4R);
751-
AF1 hitMinG=mn4G*ARcpF1(AF1_(4.0)*mx4G);
752-
AF1 hitMinB=mn4B*ARcpF1(AF1_(4.0)*mx4B);
753-
AF1 hitMaxR=(peakC.x-mx4R)*ARcpF1(AF1_(4.0)*mn4R+peakC.y);
754-
AF1 hitMaxG=(peakC.x-mx4G)*ARcpF1(AF1_(4.0)*mn4G+peakC.y);
755-
AF1 hitMaxB=(peakC.x-mx4B)*ARcpF1(AF1_(4.0)*mn4B+peakC.y);
750+
AF1 hitMinR=min(mn4R,eR)*ARcpF1(AF1_(4.0)*mx4R);
751+
AF1 hitMinG=min(mn4G,eG)*ARcpF1(AF1_(4.0)*mx4G);
752+
AF1 hitMinB=min(mn4B,eB)*ARcpF1(AF1_(4.0)*mx4B);
753+
AF1 hitMaxR=(peakC.x-max(mx4R,eR))*ARcpF1(AF1_(4.0)*mn4R+peakC.y);
754+
AF1 hitMaxG=(peakC.x-max(mx4G,eG))*ARcpF1(AF1_(4.0)*mn4G+peakC.y);
755+
AF1 hitMaxB=(peakC.x-max(mx4B,eB))*ARcpF1(AF1_(4.0)*mn4B+peakC.y);
756756
AF1 lobeR=max(-hitMinR,hitMaxR);
757757
AF1 lobeG=max(-hitMinG,hitMaxG);
758758
AF1 lobeB=max(-hitMinB,hitMaxB);
@@ -845,12 +845,12 @@ AF1 sharpness){
845845
// Immediate constants for peak range.
846846
AH2 peakC=AH2(1.0,-1.0*4.0);
847847
// Limiters, these need to be high precision RCPs.
848-
AH1 hitMinR=mn4R*ARcpH1(AH1_(4.0)*mx4R);
849-
AH1 hitMinG=mn4G*ARcpH1(AH1_(4.0)*mx4G);
850-
AH1 hitMinB=mn4B*ARcpH1(AH1_(4.0)*mx4B);
851-
AH1 hitMaxR=(peakC.x-mx4R)*ARcpH1(AH1_(4.0)*mn4R+peakC.y);
852-
AH1 hitMaxG=(peakC.x-mx4G)*ARcpH1(AH1_(4.0)*mn4G+peakC.y);
853-
AH1 hitMaxB=(peakC.x-mx4B)*ARcpH1(AH1_(4.0)*mn4B+peakC.y);
848+
AH1 hitMinR=min(mn4R,eR)*ARcpH1(AH1_(4.0)*mx4R);
849+
AH1 hitMinG=min(mn4G,eG)*ARcpH1(AH1_(4.0)*mx4G);
850+
AH1 hitMinB=min(mn4B,eB)*ARcpH1(AH1_(4.0)*mx4B);
851+
AH1 hitMaxR=(peakC.x-max(mx4R,eR))*ARcpH1(AH1_(4.0)*mn4R+peakC.y);
852+
AH1 hitMaxG=(peakC.x-max(mx4G,eG))*ARcpH1(AH1_(4.0)*mn4G+peakC.y);
853+
AH1 hitMaxB=(peakC.x-max(mx4B,eB))*ARcpH1(AH1_(4.0)*mn4B+peakC.y);
854854
AH1 lobeR=max(-hitMinR,hitMaxR);
855855
AH1 lobeG=max(-hitMinG,hitMaxG);
856856
AH1 lobeB=max(-hitMinB,hitMaxB);
@@ -963,12 +963,12 @@ AF1 sharpness){
963963
// Immediate constants for peak range.
964964
AH2 peakC=AH2(1.0,-1.0*4.0);
965965
// Limiters, these need to be high precision RCPs.
966-
AH2 hitMinR=mn4R*ARcpH2(AH2_(4.0)*mx4R);
967-
AH2 hitMinG=mn4G*ARcpH2(AH2_(4.0)*mx4G);
968-
AH2 hitMinB=mn4B*ARcpH2(AH2_(4.0)*mx4B);
969-
AH2 hitMaxR=(peakC.x-mx4R)*ARcpH2(AH2_(4.0)*mn4R+peakC.y);
970-
AH2 hitMaxG=(peakC.x-mx4G)*ARcpH2(AH2_(4.0)*mn4G+peakC.y);
971-
AH2 hitMaxB=(peakC.x-mx4B)*ARcpH2(AH2_(4.0)*mn4B+peakC.y);
966+
AH2 hitMinR=min(mn4R,eR)*ARcpH2(AH2_(4.0)*mx4R);
967+
AH2 hitMinG=min(mn4G,eG)*ARcpH2(AH2_(4.0)*mx4G);
968+
AH2 hitMinB=min(mn4B,eB)*ARcpH2(AH2_(4.0)*mx4B);
969+
AH2 hitMaxR=(peakC.x-max(mx4R,eR))*ARcpH2(AH2_(4.0)*mn4R+peakC.y);
970+
AH2 hitMaxG=(peakC.x-max(mx4G,eG))*ARcpH2(AH2_(4.0)*mn4G+peakC.y);
971+
AH2 hitMaxB=(peakC.x-max(mx4B,eB))*ARcpH2(AH2_(4.0)*mn4B+peakC.y);
972972
AH2 lobeR=max(-hitMinR,hitMaxR);
973973
AH2 lobeG=max(-hitMinG,hitMaxG);
974974
AH2 lobeB=max(-hitMinB,hitMaxB);

readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ To build the FSR sample, please follow the following instructions:
3939
1) Install the following tools:
4040

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

4547
2) Generate the solutions:
4648
```

sample/src/DX12/FSRSample.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ FSRSample::FSRSample(LPCSTR name) : FrameworkWindows(name)
3131
m_bPlay = true;
3232

3333
m_pGltfLoader = NULL;
34-
mipBias[0] = -0.3f;
35-
mipBias[1] = -0.5f;
36-
mipBias[2] = -0.7f;
34+
mipBias[0] = -0.38f;
35+
mipBias[1] = -0.585f;
36+
mipBias[2] = -0.75f;
3737
mipBias[3] = -1.0f;
3838
mipBias[4] = 0.0f;
3939
}
@@ -692,7 +692,7 @@ void FSRSample::BuildUI()
692692
m_swapChain.SetVSync(m_VsyncEnabled);
693693
ImGui::Spacing();
694694
ImGui::Spacing();
695-
const char* fullscreenModes[] = { "Windowed", "BorderlessFullscreen", "ExclusiveFulscreen" };
695+
const char* fullscreenModes[] = { "Windowed", "BorderlessFullscreen", "ExclusiveFullscreen" };
696696
if (ImGui::Combo("Fullscreen Mode", (int*)&m_fullscreenMode, fullscreenModes, _countof(fullscreenModes)))
697697
{
698698
if (m_previousFullscreenMode != m_fullscreenMode)
@@ -917,7 +917,7 @@ int WINAPI WinMain(HINSTANCE hInstance,
917917
LPSTR lpCmdLine,
918918
int nCmdShow)
919919
{
920-
LPCSTR Name = "FidelityFX Super Resolution 1.0";
920+
LPCSTR Name = "FidelityFX Super Resolution 1.0.2";
921921

922922
// create new DX sample
923923
return RunFramework(hInstance, lpCmdLine, nCmdShow, new FSRSample(Name));

sample/src/VK/FSRSample.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ FSRSample::FSRSample(LPCSTR name) : FrameworkWindows(name)
3030
m_bPlay = true;
3131

3232
m_pGltfLoader = NULL;
33-
mipBias[0] = -0.3f;
34-
mipBias[1] = -0.5f;
35-
mipBias[2] = -0.7f;
33+
mipBias[0] = -0.38f;
34+
mipBias[1] = -0.585f;
35+
mipBias[2] = -0.75f;
3636
mipBias[3] = -1.0f;
3737
mipBias[4] = 0.0f;
3838
}
@@ -718,7 +718,7 @@ void FSRSample::BuildUI()
718718
}
719719
ImGui::Spacing();
720720
ImGui::Spacing();
721-
const char* fullscreenModes[] = { "Windowed", "BorderlessFullscreen", "ExclusiveFulscreen" };
721+
const char* fullscreenModes[] = { "Windowed", "BorderlessFullscreen", "ExclusiveFullscreen" };
722722
if (ImGui::Combo("Fullscreen Mode", (int*)&m_fullscreenMode, fullscreenModes, _countof(fullscreenModes)))
723723
{
724724
if (m_previousFullscreenMode != m_fullscreenMode)
@@ -945,7 +945,7 @@ int WINAPI WinMain(HINSTANCE hInstance,
945945
LPSTR lpCmdLine,
946946
int nCmdShow)
947947
{
948-
LPCSTR Name = "FidelityFX Super Resolution 1.0";
948+
LPCSTR Name = "FidelityFX Super Resolution 1.0.2";
949949

950950
// create new Vulkan sample
951951
return RunFramework(hInstance, lpCmdLine, nCmdShow, new FSRSample(Name));

sample/src/VK/FSR_Pass.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
#endif
6363
#if SAMPLE_RCAS
6464
#define FSR_RCAS_H
65-
AH4 FsrRcasLoadH(ASW2 p) { return InputTexture.Load(ASW3(ASW2(p), 0)); }
65+
AH4 FsrRcasLoadH(ASW2 p) { return (AH4)InputTexture.Load(ASW3(ASW2(p), 0)); }
6666
void FsrRcasInputH(inout AH1 r,inout AH1 g,inout AH1 b){}
6767
#endif
6868
#endif

0 commit comments

Comments
 (0)