Giter VIP home page Giter VIP logo

fidelityfx-fsr's Issues

FSR code doesn't compile for HLSL 2021

Hi,

Microsoft recently upgraded its DXC compiler with new HLSL features.

In HLSL 2021, int3 Z = X ? 1 : 0; has to be replaced with int3 Z = select(X, 1, 0);:

In the case of FSR, lines 2040-2042 in ffx_a.h:

AF2 AZolZeroPassF2(AF2 x,AF2 y){return AF2_AU2((AU2_AF2(x)!=AU2_(0))?AU2_(0):AU2_AF2(y));}
AF3 AZolZeroPassF3(AF3 x,AF3 y){return AF3_AU3((AU3_AF3(x)!=AU3_(0))?AU3_(0):AU3_AF3(y));}
AF4 AZolZeroPassF4(AF4 x,AF4 y){return AF4_AU4((AU4_AF4(x)!=AU4_(0))?AU4_(0):AU4_AF4(y));}

Gives this error:

ffx_a.h:2040:124: error: condition for short-circuiting ternary operator must be scalar
  float32_t2 AZolZeroPassF2(float32_t2 x,float32_t2 y){return asfloat(uint32_t2((asuint(float32_t2(x))!=AU2_x(uint32_t(0)))?AU2_x(uint32_t(0)):asuint(float32_t2(y))));}

It can be fixed this way:

AF2 AZolZeroPassF2(AF2 x,AF2 y){return AF2_AU2(select(AU2_AF2(x)!=AU2_(0),AU2_(0),AU2_AF2(y)));}
AF3 AZolZeroPassF3(AF3 x,AF3 y){return AF3_AU3(select(AU3_AF3(x)!=AU3_(0),AU3_(0),AU3_AF3(y)));}
AF4 AZolZeroPassF4(AF4 x,AF4 y){return AF4_AU4(select(AU4_AF4(x)!=AU4_(0),AU4_(0),AU4_AF4(y)));}

Alternatively, one can use the __HLSL_VERSION to detect if the shader is being compiled with -HV 2021:

#if __HLSL_VERSION==2021
  AF2 AZolZeroPassF2(AF2 x,AF2 y){return AF2_AU2(select(AU2_AF2(x)!=AU2_(0),AU2_(0),AU2_AF2(y)));}
  AF3 AZolZeroPassF3(AF3 x,AF3 y){return AF3_AU3(select(AU3_AF3(x)!=AU3_(0),AU3_(0),AU3_AF3(y)));}
  AF4 AZolZeroPassF4(AF4 x,AF4 y){return AF4_AU4(select(AU4_AF4(x)!=AU4_(0),AU4_(0),AU4_AF4(y)));}
#else
  AF2 AZolZeroPassF2(AF2 x,AF2 y){return AF2_AU2((AU2_AF2(x)!=AU2_(0))?AU2_(0):AU2_AF2(y));}
  AF3 AZolZeroPassF3(AF3 x,AF3 y){return AF3_AU3((AU3_AF3(x)!=AU3_(0))?AU3_(0):AU3_AF3(y));}
  AF4 AZolZeroPassF4(AF4 x,AF4 y){return AF4_AU4((AU4_AF4(x)!=AU4_(0))?AU4_(0):AU4_AF4(y));}
#endif

question about luma*2

Hi!
about RCAS, why it is calculated as L = B*0.5 + (R*0.5) + G? I searched Luma at wikiใ€‚
B's coefficient seems is always <= 1.2, why using 0.5 as B's coefficents in code?

  // Luma times 2.
  AF1 bL=bB*AF1_(0.5)+(bR*AF1_(0.5)+bG);
  AF1 dL=dB*AF1_(0.5)+(dR*AF1_(0.5)+dG);

I'm very confused about this , cloud you please teach me?
Thanks so much!

Quality issue on FSR input to target Res table

Hi,
So I've checked the suggested input Res like 1477x831, 1130x635, 1506x847... Do not follow good practice of divisibility by 4 to minimize artifacts from rounding or padding.
One part of the justification comes from 4x4 blocks are standard in processing. Another is padded pixels/edges bleeds spectral energy/noise. Examples integer scaling and/or Wavelet, cosine, haar transform these blocks.

At <=1080p target this is much more important.

For example TRIXX boost skips some non-divisible scales in their config slider.

(In the documents a few Res where badly rounded or off-by-one )

Ps.: at least require mod 2 vertical input (2x2, 2x4 slices)

RTX16 FP16 support

Hi!
There is no information in integration overview about RTX16 series and FP16 support. 1650 supports FP16 but outputs black screen when I try it (DX11, SM5.0). Should it work?

Noise related

Hi Rys:
You said "FSR's algorithm can potentially exacerbate high frequency input".
So does the following steps theoretically help(I don't have access to the render pipe, only the final render result):

  1. Apply Fourier Transform on the target to remove high frequency part
  2. Apply FSR
  3. put high frequency part back to the target

[iGPU as FSR Renderer] AMD Advantage Program Laptops

Attn FSR Team,

Below Twitter video shares how iGPU could be utilized to boost FSR performance (10-25 FPS gain) by offloading FSR to iGPU and allowing dGPU handle the game code itself:
https://twitter.com/Rommex1/status/1442579419177144322

I wonder if this could becoming an official feature, as laptops such as AMD Advantage Program units (ASUS, MSI, Dell), where you have iGPU from AMD and dGPU from AMD, allowing iGPU handle FSR, could be indeed an interesting feature.

Share your thoughts please,

Thank you.

AMD should reuse/adapt the academic State Of The Arts

Hi @rys
It is often deeply institutionalized in companies and even in the human nature, to reinvent the wheel or to work in isolation.
I have much admiration for AMD and its software developers and trying new approaches is a way to drive innovation.
AMD FSR while not using neural networks is a very interesting way to look at the problem.

But please AMD you are not alone, there is a widespread community of very smart people out there: the scholars and they regularly release innovations in machine learning, especially regarding the topic of super-resolution.
It would be a shame if you didn't take strong inspiration from their amazing ideas that can be combined in order to create a synergetic algorithm, on par or superior to DLSS.

The #1 reference website for tracking the state of the art is paperswithcode.com
See:
https://paperswithcode.com/task/multi-frame-super-resolution
https://paperswithcode.com/task/image-super-resolution
https://paperswithcode.com/task/video-super-resolution
https://paperswithcode.com/task/super-resolution
https://paperswithcode.com/task/3d-object-super-resolution
Note that i also invite for a collaboration with Intel XeSS.
You might also take inspiration from this new Nvidia open source library:
https://www.phoronix.com/scan.php?page=news_item&px=NVIDIA-Image-Scaling-SDK

The graal would be if for your next neural based DLSS competitor, to publish your results (PSNR, SSIM) on the same benchmarcks as paperswithcode.com, additionally it would be a great scientific contribution if you could submit to paperswithcode.com game/textures oriented datasets.

Question to FSR Team at AMD

Question Below:

Could you tell us more about how FSR benefits from the programmable cores within RDNA2 and if we have any plans to see AI/ML based FSR in the future? Now with AMD having data center facilities and powerful ML machines, it could be interesting.

Video Guide + Discord?

  1. Where can I find a descriptive, non-vague video guide for implementation?

  2. Will there be a discord for support?

Upscale alpha channel in EASU

Can you please add option for getting alpha channel in the EASU upscaler?
Now only RGB get upscaled, but I need Alpha too.
Thanks!

Possible forgotten use of FSR_RCAS_DENOISE?

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!

Noise free feature

In FSR integration guide, it suggests FSR should be used before any effects introduce noise, if there is case I can't access engine source code, so I cant avoid this. Is there any idea or direction to investigate to apply FSR on the final image which has noise effect?

Denorm handling on nvidia GPUs

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.

Linux support

Any chance we can have samples for Linux using Vulkan?

Performance Analysis

Hello did anyone some kind of performance analysis ? Just to check where to gain further performance !!!

Kind regards

Strange noise

When I execute the FSRSample in my system (AMD RX 6800 XT Midnight Black), I hear a high-pitch noise apparently coming from the GPU. The noise changes as I rotate the scene or change options. I doesn't seem caused by fans, this doesn't happen running any game or other GPU-intensive program, including the Radeon app's GPU Stress Test. I am not crazy :) I can share a video that will show this behavior if necessary, the noise is low but very noticeable.

Wasm support

Do you think it might be possible to create a version thay runs in the browser. You could send a 720p stream and then upscale it to 1080p in the browser saving a ton of bandwidth?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.