FidelityFX FSR Overview Integration

Download as pdf or txt
Download as pdf or txt
You are on page 1of 37

Last revision: 18 August 2021

OVERVIEW

AMD FIDELITYFX SUPER RESOLUTION 1.0 2


WHAT IS FIDELITYFX SUPER RESOLUTION?
AMD FidelityFX Super Resolution (FSR) is our open source high-quality solution
designed to produce high resolution frames from lower resolution inputs.

It uses a collection of cutting-edge methods with a particular emphasis on creating


high-quality edges, giving large performance improvements compared to rendering
at native resolution directly.

FSR can enable “practical performance” for costly render operations, such as
hardware ray tracing.

AMD FIDELITYFX SUPER RESOLUTION 1.0 3


WHY USE AMD FIDELITYFX SUPER RESOLUTION 1.0?

Super Resolution Cross-platform Open source Easy to integrate Highly optimized


Generates “super resolution” Run on a wide variety of GPUs Provided on GPUOpen under an Full source provided. Hand-optimized for great
image each input frame. including older architectures. MIT license. performance across a wide
Native samples and UE4 patch variety of GPUs.
Support for any area scale Can be ported onto multiple provided.
factor between 1X and 4X. platforms without restriction.
Also available in Xbox GDKX.
Large performance improvements
over native rendering. Requires no historical context.

AMD FIDELITYFX SUPER RESOLUTION 1.0 4


CROSS-PLATFORM
FidelityFX Super Resolution runs on a wide range of GPUs.
• No vendor-specific code path.
• Previous architectures supported – current GPUs will benefit!
• Samples provided for DirectX® 12 and Vulkan® - but FSR 1.0 shaders compile and run on DirectX® 11 too.

Port without restriction

AMD FIDELITYFX SUPER RESOLUTION 1.0 5


OPEN SOURCE
Full source of FidelityFX Super Resolution 1.0 is hosted on GPUOpen
• Licensed under permissive MIT open source license.
• https://gpuopen.com/fsr

Code can be freely modified and redistributed


subject to license.

AMD FIDELITYFX SUPER RESOLUTION 1.0 6


EASY TO INTEGRATE
The lowest barrier to entry Simple compute shaders
• Same great experience can be expected from FidelityFX. • No additional texture/buffer input.
• No separate rendering of alpha geometry.
Integration effort estimates
• No history buffer.
Less than a day for engines supporting display
resolution decoupled from render resolution Constant buffer parameters • No motion vectors.
A few more days required to add support for
such decoupling if not already supported
• Full source provided.

Low resolution render Super resolution output


Compute shaders
Image from Dirt 5 used with permission from Codemasters®

AMD FIDELITYFX SUPER RESOLUTION 1.0 7


HIGHLY OPTIMIZED
FidelityFX Super Resolution is hand-optimized for great performance across a wide
variety of GPUs.
• Does not require enthusiast-class GPUs to run!
• VALU-bound shader on most devices.

Runs in FP16 mode by default for faster performance with no visible quality impact.
• Note: Pre-Vega architectures that don’t support FP16 packed maths may run the FP32 version of FSR 1 at better
performance.
• Please refer to detection code in the sample.

AMD FIDELITYFX SUPER RESOLUTION 1.0 8


FSR PERFORMANCE OVERHEAD
Enthusiast GPUs Performance GPUs Mainstream GPUs
FSR Target resolution (AMD RADEON™ RX 6800XT, (AMD RADEON™ RX 6700XT, (AMD RADEON™ RX 5700XT,
NVIDIA RTX 3080) NVIDIA RTX 3060 Ti) NVIDIA RTX 2060 SUPER)

4K 0.40 ms 0.60 ms 1.0 ms


Ultra Quality
Quality or less or less or less
Balanced
Performance

1440p 0.20 ms 0.30 ms 0.50 ms


Ultra Quality
Quality or less or less or less
Balanced
Performance

All numbers measured on FSR 1.0 public version


See last page for configuration details

AMD FIDELITYFX SUPER RESOLUTION 1.0 9


FSR QUALITY MODES
Input Output
FSR 1.0 quality mode Description Scale factor
resolution resolution

Ultra Quality mode produces an image with 1477 x 831 1920 x 1080
quality virtually indistinguishable from native 1.3x per dimension 1970 x 1108 2560 x 1440
Ultra Quality rendering. It should be selected when the (1.69x area scale) 2646 x 1108 3440 x 1440
highest quality is desired. (77% screen resolution)
2954 x 1662 3840 x 2160

1280 x 720 1920 x 1080


Quality mode produces a super resolution 1.5x per dimension 1706 x 960 2560 x 1440
Quality image with quality representative of native (2.25x area scale) 2293 x 960 3440 x 1440
rendering, with a sizeable performance gain. (67% screen resolution) 2560 x 1440 3840 x 2160

Balanced mode produces a super resolution 1129 x 635 1920 x 1080


image approximating native rendering quality, 1.7x per dimension 1506 x 847 2560 x 1440
Balanced with a major performance gain compared to (2.89x area scale) 2024 x 847 3440 x 1440
native. (59% screen resolution) 2259 x 1270 3840 x 2160

Performance mode visibly impacts image 960 x 540 1920 x 1080


quality and should only be selected in 2.0x per dimension 1280 x 720 2560 x 1440
Performance situations where needing additional (4x area scale) 1720 x 720 3440 x 1440
performance is critical. (50% screen resolution)
1920 x 1080 3840 x 2160

For consistency AMD recommends using these quality presets when exposing FSR in your game!

AMD FIDELITYFX SUPER RESOLUTION 1.0 10


INTEGRATION GUIDE

AMD FIDELITYFX SUPER RESOLUTION 1.0 11


INTEGRATION STEPS

.h 𝑓(𝑥)

Two header files:


FSR and Call EASU and Compute shader Apply negative
FidelityFX RCAS functions. dispatches. LoD bias for best
portability. results.

AMD FIDELITYFX SUPER RESOLUTION 1.0 12


WHERE IN MY FRAME?
Effects introducing noise
should run after
super resolution scaling

Upscaling pass (EASU) Sharpening pass (RCAS)

Film grain,
Anti-aliased Tone
chromatic HUD
render mapping aberration, etc.

Perceptual color space


(sRGB, not linear)

AMD FIDELITYFX SUPER RESOLUTION 1.0 13


WHAT FSR NEEDS
Image should be well anti-aliased. For example: TAA, MSAA, etc.

Input image must be normalized to [0-1] and be in perceptual space.


• Negative input result in RCAS will output NaN!

Image should be generated using negative MIP bias to increase texture detail.

Image should be noise-free.

AMD FIDELITYFX SUPER RESOLUTION 1.0 14


EASU SETUP FUNCTION
Include:
• ffx_a.h
• ffx_fsr1.h

Call FsrEasuCon() to setup the


EASU constants.
• Packs the input and output resolutions
into a convenient block to copy to the
GPU.
• Call FsrEasuConOffset() if
you need an input offset.

AMD FIDELITYFX SUPER RESOLUTION 1.0 15


RCAS SETUP FUNCTION
Include ffx_a.h and ffx_fsr1.h.

Call FsrRcasCon() to setup the RCAS constants.


• As RCAS works on full-screen images, the only input is sharpness.

AMD FIDELITYFX SUPER RESOLUTION 1.0 16


EASU SHADER PREPARATION
EASU should be run as a compute shader.
Prepare a compute shader with the ffx_a.h and ffx_fsr1.h headers.

EASU needs 6 functions (3 for FP16(H) mode and 3 for FP32(F) mode) specified to handle
texture loading:

AMD FIDELITYFX SUPER RESOLUTION 1.0 17


EASU SHADER PREPARATION
To improve cache utilization, swizzle the dispatch threads using ARmp8x8 included in
ffx_a.h. The function assumes a linear 64 threadgroup:

Then call FsrEasuH()/FsrEasuF() with the swizzled coordinates, and the


constants we set up before:

AMD FIDELITYFX SUPER RESOLUTION 1.0 18


To further improve cache utilization, call the function four times in each thread.
Finally, store the results, including a viewport offset if needed:

AMD FIDELITYFX SUPER RESOLUTION 1.0 19


RCAS SHADER PREPARATION
RCAS should be run as a compute shader.
• Prepare a compute shader with the ffx_a.h and ffx_fsr1.h headers.

RCAS needs six functions (two for each mode) specified to handle texture loading and
colour-space conversion if needed:

AMD FIDELITYFX SUPER RESOLUTION 1.0 20


To improve cache utilization, swizzle the dispatch threads using ARmp8x8 is included in
ffx_a.h. The function assumes a linear 64 threadgroup:

Then call FsrRcasH/FsrRcasH2/FsrEasuF with the swizzled coordinates, and the


constants we set up before:

AMD FIDELITYFX SUPER RESOLUTION 1.0 21


RCAS SHADER PREPARATION
To further improve cache utilization, call the function four times in each thread.
Finally, store the results, including a viewport offset if needed:

AMD FIDELITYFX SUPER RESOLUTION 1.0 22


DISPATCH THE SHADER
Since each invocation of the shader runs on four pixels, and the swizzle function assume
64 threads per thread group, divide the OUTPUT image resolution by 16 for the dispatch:

That's it! You are now ready for

AMD FIDELITYFX SUPER RESOLUTION 1.0 23


NEGATIVE MIP BIAS
Applying a negative MIP bias will typically generate an FSR 1.0 quality mode Scale factor MIP bias
upscaled image with better texture detail.
• Experiment for best results. Ultra Quality 1.3x per dimension -0.38

Bias to apply (adjust as desired): Quality 1.5x per dimension -0.58


• MIP bias = -log2(DisplayResolution/SourceResolution)
Balanced 1.7x per dimension -0.79

Provided FSR 1.0 samples set negative MIP bias slider to


suitable defaults based on quality mode selected. Performance 2.0x per dimension -1.0

AMD FIDELITYFX SUPER RESOLUTION 1.0 24


RCAS SHARPENING AMOUNT
RCAS sharpness parameter is specified in ‘stops’.
• Sharpness halves with every whole number.
• Goes from 0.0 (sharpest) to about 2.0.
• Values above 2.0 won’t make a visible difference.

A good recommended default value for RCAS Include is 0.2.


• Adjust as needed based on preferences.

AMD FIDELITYFX SUPER RESOLUTION 1.0 25


HDR DISPLAY SUPPORT
Input needs to be encoded as sRGB or Gamma 2.0 UNORM.
• PQ or HLG are not suitable encodings for input.

Avoid banding in input as FSR will highlight it further.


• Optimally use dithering to keep input as R10G10B10A2_UNORM.

Multiple utilities included in ffx_fsr1.h.


• Temporal Energy Preserving Dither – helps avoid banding in input.
• Simple Reversible Tone-Mapper – normalizes linear HDR.
• Quick approximate reversible PQ to Gamma 2.0 conversion.

AMD FIDELITYFX SUPER RESOLUTION 1.0 26


FULL PRECISION FALLBACK
FSR 1.0 was designed to take advantage of half precision (FP16) for best performance.
• A slower full precision (FP32) fallback is included to run on older hardware.

Direct3D apps:
• Query D3D[11/12]_FEATURE_DATA_SHADER_MIN_PRECISION_SUPPORT.
• If D3D[11/12]_SHADER_MIN_PRECISION_16_BIT is not set, fallback to FP32.

Vulkan apps:
• If VkPhysicalDeviceFloat16Int8FeaturesKHR f.shaderFloat16 is not set, fallback to FP32.
• If VkPhysicalDevice16BitStorageFeatures f.storageBuffer16BitAccess is not set, fallback to
FP32.

AMD FIDELITYFX SUPER RESOLUTION 1.0 27


WHEN TO RUN THE FP32 FALLBACK
GPU FSR 1.0 Precision GPU FSR 1.0 Precision

AMD Radeon™ RX 6000 Series FP16 NVIDIA GeForce 30 Series FP16 *

AMD Radeon™ RX 5000 Series FP16 NVIDIA GeForce 20 Series FP16

AMD Radeon™ RX Vega Series FP16 NVIDIA GeForce 10 Series Fallback to FP32

AMD Radeon™ RX 400 Series Fallback to FP32 NVIDIA GeForce 900 Series Fallback to FP32

AMD Radeon™ RX 500 Series Fallback to FP32 Intel UHD Graphics FP16

* You may encounter image corruption issues on NVIDIA RTX 3000 series when FP16 FSR shaders are used with DirectX 11. If this issue manifests itself then
the FP32 version of FSR should be used on these GPUs until NVIDIA issues a driver fix. This issue does not affect DirectX 12 or Vulkan.

AMD FIDELITYFX SUPER RESOLUTION 1.0 28


USER INTERFACE GUIDE

AMD FIDELITYFX SUPER RESOLUTION 1.0 29


FSR UI GUIDELINES - NAMING
Recommended UI names for FidelityFX Super Resolution 1.0:
• “AMD FidelityFX Super Resolution 1.0”
• “FidelityFX Super Resolution 1.0”
• “AMD FSR 1.0”

Recommended UI description for FidelityFX Super Resolution 1.0:


• “AMD FidelityFX Super Resolution 1.0 is a cutting edge super-optimized spatial upscaling technology that produces
impressive image quality at fast framerates.”

Recommended UI descriptions for FSR 1.0 quality presets:


• Please use quality preset descriptions from the table on slide 10.

AMD FIDELITYFX SUPER RESOLUTION 1.0 30


FSR UI GUIDELINES - UI EXAMPLE
Please list FSR quality presets from highest to lowest quality.
• An example is shown below:

AMD FidelityFX Super Resolution 1.0

Off Ultra Quality Quality Balanced Performance

It is recommended that the default mode for FSR is either OFF or Ultra Quality.

AMD FIDELITYFX SUPER RESOLUTION 1.0 31


FSR UI GUIDELINES – ANTI-ALIASING
FSR 1.0 applied on a non anti-aliased input image will likely return poor results.
• Hard edges will be detected as such and exacerbated in the upscaled image!

To avoid this situation please implement either of the following options:

• Enabling FSR automatically enables the highest-quality AA option such as TAA, MSAA 8x etc.

• The FSR 1.0 option becomes grayed out if the game’s AA option is set to “Off” or “None”.

AMD FIDELITYFX SUPER RESOLUTION 1.0 32


FSR UI GUIDELINES – SHARPENING
FSR comes with its own sharpening pass.

If your game already supports a sharpening option in the UI please gray out sharpening UI
when FSR is enabled.
• This is to avoid a clash with the RCAS sharpening feature of FSR.

Please do not explicitly mention “RCAS” in UI – it is part of the FSR 1.0 solution!

Please do not use FSR RCAS without EASU upscaling!


• If sharpening is desired without FSR upscaling, then FidelityFX CAS is recommended instead.

AMD FIDELITYFX SUPER RESOLUTION 1.0 33


TALK TO US!
Please contact your AMD representative if you integrate FSR in your game!
We may be able to help promote your game on social channels

AMD FIDELITYFX SUPER RESOLUTION 1.0 34


CONFIGURATION FOR PERFORMANCE TESTING
Motherboard: MSI X570-A Pro
CPU: AMD Ryzen 9 5900X @ 3.70 Ghz
Chipset: Ryzen SOC
System RAM: 16GB G.Skill DDR4-3600 CL16-16-16-36
OS: Windows 10 Pro 64-bit (OS Build 19042.928)
AMD driver version: 21.20-210624n
NVIDIA driver version: 471.11

AMD FIDELITYFX SUPER RESOLUTION 1.0 36


DISCLAIMER
The information contained herein is for informational purposes only, and is subject to change without notice. While every
precaution has been taken in the preparation of this document, it may contain technical inaccuracies, omissions and
typographical errors, and AMD is under no obligation to update or otherwise correct this information. Advanced Micro Devices,
Inc. makes no representations or warranties with respect to the accuracy or completeness of the contents of this document, and
assumes no liability of any kind, including the implied warranties of noninfringement, merchantability or fitness for particular
purposes, with respect to the operation or use of AMD hardware, software or other products described herein. No license,
including implied or arising by estoppel, to any intellectual property rights is granted by this document. Terms and limitations
applicable to the purchase or use of AMD’s products are as set forth in a signed agreement between the parties or in AMD's
Standard Terms and Conditions of Sale. GD-18.
AMD FidelityFX Super Resolution is supported on the following AMD products: AMD Radeon™ RX 6000, RX 5000, RX 500, RX
Vega series graphics cards, RX 480, RX 470, RX 460, and all AMD Ryzen™ Processors with Radeon™ Graphics if the minimum
requirements of the game are met. AMD does not provide technical or warranty support for AMD FidelityFX Super Resolution
enablement on other vendor's graphics cards. GD-187
©2021 Advanced Micro Devices, Inc. All rights reserved. AMD, the AMD Arrow logo, Radeon, Ryzen and combinations thereof are
trademarks of Advanced Micro Devices, Inc.
Vulkan and the Vulkan logo are registered trademarks of the Khronos Group Inc. PCIe and PCI Express are registered trademarks of
the PCI-SIG Corporation. DirectX is a registered trademark of Microsoft Corporation in the US and other jurisdictions.
Other product names used in this publication are for identification purposes only and may be trademarks of their respective
companies.

AMD FIDELITYFX SUPER RESOLUTION 1.0 37

You might also like