Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible forgotten use of FSR_RCAS_DENOISE? #31

Open
CptLucky8 opened this issue Jan 16, 2022 · 2 comments
Open

Possible forgotten use of FSR_RCAS_DENOISE? #31

CptLucky8 opened this issue Jan 16, 2022 · 2 comments

Comments

@CptLucky8
Copy link

CptLucky8 commented Jan 16, 2022

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:

AF1 nz=AF1_(0.25)*bL+AF1_(0.25)*dL+AF1_(0.25)*fL+AF1_(0.25)*hL-eL;
nz=ASatF1(abs(nz)*APrxMedRcpF1(AMax3F1(AMax3F1(bL,dL,eL),fL,hL)-AMin3F1(AMin3F1(bL,dL,eL),fL,hL)));
nz=AF1_(-0.5)*nz+AF1_(1.0);

Thanks!

@Calinou
Copy link

Calinou commented Jun 22, 2022

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 🙂

@CptLucky8
Copy link
Author

CptLucky8 commented Dec 12, 2022

@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 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants