diff --git a/README.md b/README.md index 9d4913f..dc7f284 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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 | diff --git a/changelog.md b/changelog.md index a6ccdcb..1472c9a 100644 --- a/changelog.md +++ b/changelog.md @@ -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. diff --git a/release_notes.txt b/release_notes.txt index 5f2ffb2..9491ce0 100644 --- a/release_notes.txt +++ b/release_notes.txt @@ -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 ----------- diff --git a/src/ffx-fsr2-api/ffx_fsr2.cpp b/src/ffx-fsr2-api/ffx_fsr2.cpp index b0cd593..051018e 100644 --- a/src/ffx-fsr2-api/ffx_fsr2.cpp +++ b/src/ffx-fsr2-api/ffx_fsr2.cpp @@ -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 }, @@ -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 diff --git a/src/ffx-fsr2-api/ffx_fsr2.h b/src/ffx-fsr2-api/ffx_fsr2.h index e611fef..2a1c74a 100644 --- a/src/ffx-fsr2-api/ffx_fsr2.h +++ b/src/ffx-fsr2-api/ffx_fsr2.h @@ -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. /// @@ -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 diff --git a/src/ffx-fsr2-api/shaders/ffx_fsr2_accumulate.h b/src/ffx-fsr2-api/shaders/ffx_fsr2_accumulate.h index 1c5cd16..7bd5892 100644 --- a/src/ffx-fsr2-api/shaders/ffx_fsr2_accumulate.h +++ b/src/ffx-fsr2-api/shaders/ffx_fsr2_accumulate.h @@ -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; @@ -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]); @@ -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 diff --git a/src/ffx-fsr2-api/shaders/ffx_fsr2_depth_clip.h b/src/ffx-fsr2-api/shaders/ffx_fsr2_depth_clip.h index be41b38..fa4c975 100644 --- a/src/ffx-fsr2-api/shaders/ffx_fsr2_depth_clip.h +++ b/src/ffx-fsr2-api/shaders/ffx_fsr2_depth_clip.h @@ -216,7 +216,7 @@ 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))); @@ -224,6 +224,7 @@ float EvaluateSurface(FfxInt32x2 iPxPos, FfxFloat32x2 fMotionVector) return 1.0f - FfxFloat32(((d0 - d1) > (d1 * 0.01f)) && ((d1 - d2) > (d2 * 0.01f))); } + void DepthClip(FfxInt32x2 iPxPos) { FfxFloat32x2 fDepthUv = (iPxPos + 0.5f) / RenderSize();