diff --git a/README.md b/README.md index 66d9d02..9d4913f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # FidelityFX Super Resolution 2.2 (FSR 2.2) -Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. +Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -53,7 +53,7 @@ You can find the binaries for FidelityFX FSR in the release section on GitHub. - [Mipmap biasing](#mipmap-biasing) - [Frame Time Delta Input](#frame-time-delta-input) - [HDR support](#hdr-support) - - [Falling back to 32bit floating point](#falling-back-to-32bit-floating-point) + - [Falling back to 32-bit floating point](#falling-back-to-32-bit-floating-point) - [64-wide wavefronts](#64-wide-wavefronts) - [API Debug Checker](#debug-checker) - [The technique](#the-technique) diff --git a/changelog.md b/changelog.md index 03b97b6..a6ccdcb 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,8 @@ +2023-02-23 | FidelityFX Super Resolution 2.2a +------- +- 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 ------- - Introduction of API debug checker. diff --git a/docs/media/super-resolution-temporal/reproject-and-accumulate-structure.svg b/docs/media/super-resolution-temporal/reproject-and-accumulate-structure.svg deleted file mode 100644 index 805bee9..0000000 --- a/docs/media/super-resolution-temporal/reproject-and-accumulate-structure.svg +++ /dev/null @@ -1,677 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - Pass - - Buffer - - Shading changedetection - - Update Locks - - Lock status - - Disocclusion mask - - - Rectify color - - - Accumulate - - Tonemap - - Tonemap - - Inverse tonemap - - - - - - - Upsample - - Luma history - - Current luminance - - Adjusted color - - - - Output buffer - - - Reactive mask - - - Dilated motionvectors - - Reproject - - - - - Reprojected lock status - - Output - - 5x5 Lanczos - - Y (Luminance) - - 11Clamping box - - 2x2bilinear - - 2x2bilinear15x5 Lanczos1 - - 2x2bilinear2x2 bilinear2x2bilinear - - - - - - - diff --git a/src/ffx-fsr2-api/shaders/ffx_fsr2_prepare_input_color.h b/src/ffx-fsr2-api/shaders/ffx_fsr2_prepare_input_color.h deleted file mode 100644 index a773cda..0000000 --- a/src/ffx-fsr2-api/shaders/ffx_fsr2_prepare_input_color.h +++ /dev/null @@ -1,88 +0,0 @@ -// This file is part of the FidelityFX SDK. -// -// Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#ifndef FFX_FSR2_PREPARE_INPUT_COLOR_H -#define FFX_FSR2_PREPARE_INPUT_COLOR_H - -//TODO: Move to common location & share with Accumulate -void ClearResourcesForNextFrame(in FfxInt32x2 iPxHrPos) -{ - if (all(FFX_LESS_THAN(iPxHrPos, FfxInt32x2(RenderSize())))) - { -#if FFX_FSR2_OPTION_INVERTED_DEPTH - const FfxUInt32 farZ = 0x0; -#else - const FfxUInt32 farZ = 0x3f800000; -#endif - SetReconstructedDepth(iPxHrPos, farZ); - } -} - -void ComputeLumaStabilityFactor(FfxInt32x2 iPxLrPos, FfxFloat32 fCurrentFrameLuma) -{ - FfxFloat32x4 fCurrentFrameLumaHistory = LoadRwLumaHistory(iPxLrPos); - - fCurrentFrameLumaHistory.a = FfxFloat32(0); - - if (FrameIndex() > 3) { - FfxFloat32 fDiffs0 = MinDividedByMax(fCurrentFrameLumaHistory[2], fCurrentFrameLuma); - FfxFloat32 fDiffs1 = ffxMax(MinDividedByMax(fCurrentFrameLumaHistory[0], fCurrentFrameLuma), MinDividedByMax(fCurrentFrameLumaHistory[1], fCurrentFrameLuma)); - - fCurrentFrameLumaHistory.a = ffxSaturate(fDiffs1 - fDiffs0); - } - - //move history - fCurrentFrameLumaHistory[0] = fCurrentFrameLumaHistory[1]; - fCurrentFrameLumaHistory[1] = fCurrentFrameLumaHistory[2]; - fCurrentFrameLumaHistory[2] = fCurrentFrameLuma; - - StoreLumaHistory(iPxLrPos, fCurrentFrameLumaHistory); -} - -void PrepareInputColor(FfxInt32x2 iPxLrPos) -{ - //We assume linear data. if non-linear input (sRGB, ...), - //then we should convert to linear first and back to sRGB on output. - - FfxFloat32x3 fRgb = ffxMax(FfxFloat32x3(0, 0, 0), LoadInputColor(iPxLrPos)); - - fRgb *= Exposure(); - -#if FFX_FSR2_OPTION_HDR_COLOR_INPUT - // Tonemap color, used in lockstatus and luma stability computations - fRgb = Tonemap(fRgb); -#endif - - FfxFloat32x4 fYCoCg; - - fYCoCg.xyz = RGBToYCoCg(fRgb); - - const FfxFloat32 fPerceivedLuma = RGBToPerceivedLuma(fRgb); - ComputeLumaStabilityFactor(iPxLrPos, fPerceivedLuma); - - //compute luma used to lock pixels, if used elsewhere the ffxPow must be moved! - fYCoCg.w = ffxPow(fPerceivedLuma, FfxFloat32(1.0 / 6.0)); - - StorePreparedInputColor(iPxLrPos, fYCoCg); - ClearResourcesForNextFrame(iPxLrPos); -} - -#endif // FFX_FSR2_PREPARE_INPUT_COLOR_H diff --git a/src/ffx-fsr2-api/shaders/ffx_fsr2_prepare_input_color_pass.glsl b/src/ffx-fsr2-api/shaders/ffx_fsr2_prepare_input_color_pass.glsl deleted file mode 100644 index d37e0af..0000000 --- a/src/ffx-fsr2-api/shaders/ffx_fsr2_prepare_input_color_pass.glsl +++ /dev/null @@ -1,62 +0,0 @@ -// This file is part of the FidelityFX SDK. -// -// Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// FSR2 pass 1 -// SRV 1 : m_HDR : r_input_color_jittered -// SRV 4 : FSR2_Exposure : r_exposure -// UAV 7 : FSR2_ReconstructedPrevNearestDepth : rw_reconstructed_previous_nearest_depth -// UAV 13 : FSR2_PreparedInputColor : rw_prepared_input_color -// UAV 14 : FSR2_LumaHistory : rw_luma_history -// CB 0 : cbFSR2 - -#version 450 - -#extension GL_GOOGLE_include_directive : require -#extension GL_EXT_samplerless_texture_functions : require - -#define FSR2_BIND_SRV_INPUT_COLOR 0 -#define FSR2_BIND_SRV_EXPOSURE 1 -#define FSR2_BIND_UAV_RECONSTRUCTED_PREV_NEAREST_DEPTH 2 -#define FSR2_BIND_UAV_PREPARED_INPUT_COLOR 3 -#define FSR2_BIND_UAV_LUMA_HISTORY 4 -#define FSR2_BIND_CB_FSR2 5 - -#include "ffx_fsr2_callbacks_glsl.h" -#include "ffx_fsr2_common.h" -#include "ffx_fsr2_prepare_input_color.h" - -#ifndef FFX_FSR2_THREAD_GROUP_WIDTH -#define FFX_FSR2_THREAD_GROUP_WIDTH 8 -#endif // #ifndef FFX_FSR2_THREAD_GROUP_WIDTH -#ifndef FFX_FSR2_THREAD_GROUP_HEIGHT -#define FFX_FSR2_THREAD_GROUP_HEIGHT 8 -#endif // #ifndef FFX_FSR2_THREAD_GROUP_HEIGHT -#ifndef FFX_FSR2_THREAD_GROUP_DEPTH -#define FFX_FSR2_THREAD_GROUP_DEPTH 1 -#endif // #ifndef FFX_FSR2_THREAD_GROUP_DEPTH -#ifndef FFX_FSR2_NUM_THREADS -#define FFX_FSR2_NUM_THREADS layout (local_size_x = FFX_FSR2_THREAD_GROUP_WIDTH, local_size_y = FFX_FSR2_THREAD_GROUP_HEIGHT, local_size_z = FFX_FSR2_THREAD_GROUP_DEPTH) in; -#endif // #ifndef FFX_FSR2_NUM_THREADS - -FFX_FSR2_NUM_THREADS -void main() -{ - PrepareInputColor(ivec2(gl_GlobalInvocationID.xy)); -} diff --git a/src/ffx-fsr2-api/shaders/ffx_fsr2_prepare_input_color_pass.hlsl b/src/ffx-fsr2-api/shaders/ffx_fsr2_prepare_input_color_pass.hlsl deleted file mode 100644 index bed086f..0000000 --- a/src/ffx-fsr2-api/shaders/ffx_fsr2_prepare_input_color_pass.hlsl +++ /dev/null @@ -1,64 +0,0 @@ -// This file is part of the FidelityFX SDK. -// -// Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// FSR2 pass 1 -// SRV 1 : m_HDR : r_input_color_jittered -// SRV 4 : FSR2_Exposure : r_exposure -// UAV 7 : FSR2_ReconstructedPrevNearestDepth : rw_reconstructed_previous_nearest_depth -// UAV 13 : FSR2_PreparedInputColor : rw_prepared_input_color -// UAV 14 : FSR2_LumaHistory : rw_luma_history -// CB 0 : cbFSR2 - -#define FSR2_BIND_SRV_INPUT_COLOR 0 -#define FSR2_BIND_SRV_EXPOSURE 1 -#define FSR2_BIND_UAV_RECONSTRUCTED_PREV_NEAREST_DEPTH 0 -#define FSR2_BIND_UAV_PREPARED_INPUT_COLOR 1 -#define FSR2_BIND_UAV_LUMA_HISTORY 2 -#define FSR2_BIND_CB_FSR2 0 - -#include "ffx_fsr2_callbacks_hlsl.h" -#include "ffx_fsr2_common.h" -#include "ffx_fsr2_prepare_input_color.h" - -#ifndef FFX_FSR2_THREAD_GROUP_WIDTH -#define FFX_FSR2_THREAD_GROUP_WIDTH 8 -#endif // #ifndef FFX_FSR2_THREAD_GROUP_WIDTH -#ifndef FFX_FSR2_THREAD_GROUP_HEIGHT -#define FFX_FSR2_THREAD_GROUP_HEIGHT 8 -#endif // #ifndef FFX_FSR2_THREAD_GROUP_HEIGHT -#ifndef FFX_FSR2_THREAD_GROUP_DEPTH -#define FFX_FSR2_THREAD_GROUP_DEPTH 1 -#endif // #ifndef FFX_FSR2_THREAD_GROUP_DEPTH -#ifndef FFX_FSR2_NUM_THREADS -#define FFX_FSR2_NUM_THREADS [numthreads(FFX_FSR2_THREAD_GROUP_WIDTH, FFX_FSR2_THREAD_GROUP_HEIGHT, FFX_FSR2_THREAD_GROUP_DEPTH)] -#endif // #ifndef FFX_FSR2_NUM_THREADS - -FFX_FSR2_NUM_THREADS -FFX_FSR2_EMBED_ROOTSIG_CONTENT -void CS( - uint2 uGroupId : SV_GroupID, - uint2 uDispatchThreadId : SV_DispatchThreadID, - uint2 uGroupThreadId : SV_GroupThreadID, - uint uGroupIndex : SV_GroupIndex -) -{ - PrepareInputColor(uDispatchThreadId); -}