gpuopen-effects / fidelityfx-fsr Goto Github PK
View Code? Open in Web Editor NEWFidelityFX Super Resolution
License: MIT License
FidelityFX Super Resolution
License: MIT License
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
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!
Does it suppot WX5100/9100
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)
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?
For Balanced preset in the docs the bias is -0.79 but in the sample code latest commit has -0.75 ;
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):
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.
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.
When the "SAMPLE_SLOW_FALLBACK " is disabled, The DirectX Shader Compiler shows the warning:
Dxil Compile: EngineShaders/FSR_Pass.hlsl:63:37: warning: conversion from larger type 'vector<float, 4>' to smaller type 'float16_t4', possible loss of data [-Wconversion]
AH4 FsrRcasLoadH(ASW2 p) { return InputTexture.Load(ASW3(ASW2(p), 0)); }
please help how can i compile fsr example
is there a prebuild plugin for ue 4.27 of amd fsr 1.0 ?
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.
Where can I find a descriptive, non-vague video guide for implementation?
Will there be a discord for support?
Any location to find previous releases for FSR1 UE plugin? Thanks a lot
Can you please add option for getting alpha channel in the EASU upscaler?
Now only RGB get upscaled, but I need Alpha too.
Thanks!
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:
FidelityFX-FSR/ffx-fsr/ffx_fsr1.h
Lines 737 to 739 in a21ffb8
Thanks!
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?
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.
atyuwen.github.io/posts/optimizing-fsr
Just to link to @atyuwen blog for easier
public discussion / upstream tracking.
Any chance we can have samples for Linux using Vulkan?
Hello did anyone some kind of performance analysis ? Just to check where to gain further performance !!!
Kind regards
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.
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.