GPUOpen-Effects / FidelityFX-FSR

FidelityFX Super Resolution
MIT License
2.03k stars 164 forks source link

Denorm handling on nvidia GPUs #21

Open hexley45 opened 2 years ago

hexley45 commented 2 years ago

I was having issue with the following on Nvidia GPU on Ubuntu.

void FsrSrtmInvH(inout AH3 c){c*=AH3(ARcpH1(max(AH1(1.0/32768.0),AH1_(1.0)-AMax3H1(c.r,c.g,c.b))));}

1.0/32768.0 is a FP16 denorm, color channels >= 1.0 will end up returning inf. Using 1.0/16384.0 avoids the issue.