GPUOpen-Effects / FidelityFX-FSR

FidelityFX Super Resolution
MIT License
2.05k stars 163 forks source link

Possible forgotten use of FSR_RCAS_DENOISE? #31

Open CptLucky8 opened 2 years ago

CptLucky8 commented 2 years ago

Hi,

We're implementing FSR in our project https://github.com/mbucchia/OpenXR-Toolkit and you have done an amazing job. It has been very easy to integrate and it is giving very good results in VR.

I might be wrong but unless the shader compiler optimizes this out, it seems to me the following 3 lines of code could be enclosed in a #ifdef FSR_RCAS_DENOISE block, otherwise the shader is computing the nz value for nothing:

https://github.com/GPUOpen-Effects/FidelityFX-FSR/blob/a21ffb8f6c13233ba336352bdff293894c706575/ffx-fsr/ffx_fsr1.h#L737-L739

Thanks!

Calinou commented 2 years ago

I might be wrong but unless the shader compiler optimizes this out

It might be worth checking the generated assembly with http://shader-playground.timjones.io/ to make sure :slightly_smiling_face:

CptLucky8 commented 1 year ago

@Calinou Thank you for the hint.

I might be wrong but unless the shader compiler optimizes this out,...

I've just tried for the sake of it and it did optimize this out. The #ifdef block would have probably expressed this directly, saving time by just glancing at the source code though 🙂