Skip to content

Commit

Permalink
FidelityFX FSR v2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rys committed May 31, 2023
1 parent 149cf26 commit 1680d1e
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 27 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# FidelityFX Super Resolution 2.2 (FSR 2.2)
# FidelityFX Super Resolution 2.2 (FSR 2.2.1)

Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.

Expand Down Expand Up @@ -805,6 +805,7 @@ FSR2 requires a GPU with typed UAV load and R16G16B16A16_UNORM support.
| Version | Date |
| ---------------|-------------------|
| **2.2.1** | 2023-05-12 |
| **2.2.0** | 2023-02-16 |
| **2.1.2** | 2022-10-19 |
| **2.1.1** | 2022-09-15 |
Expand Down
11 changes: 9 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
2023-02-23 | FidelityFX Super Resolution 2.2a
2023-05-12 | FidelityFX Super Resolution 2.2.1
-------
- Fixed comments in API header for incorrect cameraFar use.
- Fixed DRS issue where resource was not correctly cleared on first use.
- Fixed issue where luma instability logic could introduce output artefacts with strobing lights.
- Fixed incorrect luma resource size.

2023-02-23 | FidelityFX Super Resolution 2.2.0a
-------
- Minor updates to the documentation
- Removal of a handful of files from the prior release that are no longer part of FSR 2.2.

2023-02-16 | FidelityFX Super Resolution 2.2
2023-02-16 | FidelityFX Super Resolution 2.2.0
-------
- Introduction of API debug checker.
- Changes to improve "High Velocity Ghosting" situations.
Expand Down
21 changes: 5 additions & 16 deletions release_notes.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
FidelityFX Super Resolution 2.2
FidelityFX Super Resolution 2.2.1
=================================

Features
--------
- API debug Checker
- Changes to improve "High Velocity Ghosting" situations.

Changes
-------
- Changes to Luminance computation with pre-exposure application.
- Small motion vectors ignored in previous depth estimation.
- Changes to depth logic to improve disocclusion detection and avoid self-disocclusions.
- Dilated reactive mask logic updated to use temporal motion vector divergence to kill locks.
- New lock luminance resource.
- Accumulation overhauled to use temporal reactivity.
- Changed how intermediate signals are stored and tonemapped.
- Luminance instability logic improved.
- Tonemapping no longer applied during RCAS to retain more dynamic range.
- Fixes for multiple user reported issues on GitHub and elsewhere. Thank you for your feedback!
- Fixed comments in API header for incorrect cameraFar use.
- Fixed DRS issue where resource was not correctly cleared on first use.
- Fixed issue where luma instability logic could introduce output artefacts with strobing lights.
- Fixed incorrect luma resource size.

Limitations
-----------
Expand Down
4 changes: 3 additions & 1 deletion src/ffx-fsr2-api/ffx_fsr2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ static FfxErrorCode fsr2Create(FfxFsr2Context_Private* context, const FfxFsr2Con
FFX_SURFACE_FORMAT_R16G16_FLOAT, contextDescription->displaySize.width, contextDescription->displaySize.height, 1, FFX_RESOURCE_FLAGS_NONE },

{ FFX_FSR2_RESOURCE_IDENTIFIER_LOCK_INPUT_LUMA, L"FSR2_LockInputLuma", (FfxResourceUsage)(FFX_RESOURCE_USAGE_UAV),
FFX_SURFACE_FORMAT_R16_FLOAT, contextDescription->displaySize.width, contextDescription->displaySize.height, 1, FFX_RESOURCE_FLAGS_ALIASABLE },
FFX_SURFACE_FORMAT_R16_FLOAT, contextDescription->maxRenderSize.width, contextDescription->maxRenderSize.height, 1, FFX_RESOURCE_FLAGS_ALIASABLE },

{ FFX_FSR2_RESOURCE_IDENTIFIER_NEW_LOCKS, L"FSR2_NewLocks", (FfxResourceUsage)(FFX_RESOURCE_USAGE_UAV),
FFX_SURFACE_FORMAT_R8_UNORM, contextDescription->displaySize.width, contextDescription->displaySize.height, 1, FFX_RESOURCE_FLAGS_ALIASABLE },
Expand Down Expand Up @@ -788,6 +788,8 @@ static FfxErrorCode fsr2Dispatch(FfxFsr2Context_Private* context, const FfxFsr2D
context->contextDescription.callbacks.fpScheduleGpuJob(&context->contextDescription.callbacks, &clearJob);
clearJob.clearJobDescriptor.target = context->srvResources[FFX_FSR2_RESOURCE_IDENTIFIER_LOCK_STATUS_2];
context->contextDescription.callbacks.fpScheduleGpuJob(&context->contextDescription.callbacks, &clearJob);
clearJob.clearJobDescriptor.target = context->srvResources[FFX_FSR2_RESOURCE_IDENTIFIER_PREPARED_INPUT_COLOR];
context->contextDescription.callbacks.fpScheduleGpuJob(&context->contextDescription.callbacks, &clearJob);
}

// Prepare per frame descriptor tables
Expand Down
4 changes: 2 additions & 2 deletions src/ffx-fsr2-api/ffx_fsr2.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
/// FidelityFX Super Resolution 2 patch version.
///
/// @ingroup FSR2
#define FFX_FSR2_VERSION_PATCH (0)
#define FFX_FSR2_VERSION_PATCH (1)

/// The size of the context specified in 32bit values.
///
Expand Down Expand Up @@ -134,7 +134,7 @@ typedef struct FfxFsr2DispatchDescription {
float preExposure; ///< The pre exposure value (must be > 0.0f)
bool reset; ///< A boolean value which when set to true, indicates the camera has moved discontinuously.
float cameraNear; ///< The distance to the near plane of the camera.
float cameraFar; ///< The distance to the far plane of the camera. This is used only used in case of non infinite depth.
float cameraFar; ///< The distance to the far plane of the camera.
float cameraFovAngleVertical; ///< The camera angle field of view in the vertical direction (expressed in radians).
float viewSpaceToMetersFactor; ///< The scale factor to convert view space units to meters

Expand Down
13 changes: 9 additions & 4 deletions src/ffx-fsr2-api/shaders/ffx_fsr2_accumulate.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ FfxFloat32x3 ComputeBaseAccumulationWeight(const AccumulationPassCommonParams pa

FfxFloat32 ComputeLumaInstabilityFactor(const AccumulationPassCommonParams params, RectificationBox clippingBox, FfxFloat32 fThisFrameReactiveFactor, FfxFloat32 fLuminanceDiff)
{
const FfxFloat32 fUnormThreshold = 1.0f / 255.0f;
const FfxInt32 N_MINUS_1 = 0;
const FfxInt32 N_MINUS_2 = 1;
const FfxInt32 N_MINUS_3 = 2;
Expand All @@ -156,7 +157,8 @@ FfxFloat32 ComputeLumaInstabilityFactor(const AccumulationPassCommonParams param

FfxFloat32 fMin = abs(fDiffs0);

if (fMin >= (1.0f / 255.0f)) {
if (fMin >= fUnormThreshold)
{
for (int i = N_MINUS_2; i <= N_MINUS_4; i++) {
FfxFloat32 fDiffs1 = (fCurrentFrameLuma - fCurrentFrameLumaHistory[i]);

Expand All @@ -168,10 +170,13 @@ FfxFloat32 ComputeLumaInstabilityFactor(const AccumulationPassCommonParams param
}
}

fLumaInstability = FfxFloat32(fMin != abs(fDiffs0));
const FfxFloat32 fBoxSize = clippingBox.boxVec.x;
const FfxFloat32 fBoxSizeFactor = ffxPow(ffxSaturate(fBoxSize / 0.1f), 6.0f);

fLumaInstability *= 1.0f - ffxMax(params.fAccumulationMask, ffxPow(fThisFrameReactiveFactor, 1.0f / 3.0f));
fLumaInstability *= ffxLerp(1.0f, 0.0f, ffxSaturate(params.fHrVelocity / 20.0f));
fLumaInstability = FfxFloat32(fMin != abs(fDiffs0)) * fBoxSizeFactor;
fLumaInstability = FfxFloat32(fLumaInstability > fUnormThreshold);

fLumaInstability *= 1.0f - ffxMax(params.fAccumulationMask, ffxPow(fThisFrameReactiveFactor, 1.0f / 6.0f));
}

//shift history
Expand Down
3 changes: 2 additions & 1 deletion src/ffx-fsr2-api/shaders/ffx_fsr2_depth_clip.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,15 @@ FfxFloat32x3 ComputePreparedInputColor(FfxInt32x2 iPxLrPos)
return fPreparedYCoCg;
}

float EvaluateSurface(FfxInt32x2 iPxPos, FfxFloat32x2 fMotionVector)
FfxFloat32 EvaluateSurface(FfxInt32x2 iPxPos, FfxFloat32x2 fMotionVector)
{
FfxFloat32 d0 = GetViewSpaceDepth(LoadReconstructedPrevDepth(iPxPos + FfxInt32x2(0, -1)));
FfxFloat32 d1 = GetViewSpaceDepth(LoadReconstructedPrevDepth(iPxPos + FfxInt32x2(0, 0)));
FfxFloat32 d2 = GetViewSpaceDepth(LoadReconstructedPrevDepth(iPxPos + FfxInt32x2(0, 1)));

return 1.0f - FfxFloat32(((d0 - d1) > (d1 * 0.01f)) && ((d1 - d2) > (d2 * 0.01f)));
}

void DepthClip(FfxInt32x2 iPxPos)
{
FfxFloat32x2 fDepthUv = (iPxPos + 0.5f) / RenderSize();
Expand Down

0 comments on commit 1680d1e

Please sign in to comment.