From 4801535236bcf7d36f27297cef4a24b840d02d07 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Thu, 23 Feb 2023 16:21:15 +0100 Subject: [PATCH] Removed shader that was made obsolete as part of FSR 2.2 --- .../ffx_fsr2_prepare_input_color_pass.compute | 14 --- ...fsr2_prepare_input_color_pass.compute.meta | 8 -- .../shaders/ffx_fsr2_prepare_input_color.h | 88 ------------------- .../ffx_fsr2_prepare_input_color.h.meta | 27 ------ .../ffx_fsr2_prepare_input_color_pass.hlsl | 64 -------------- ...fx_fsr2_prepare_input_color_pass.hlsl.meta | 7 -- 6 files changed, 208 deletions(-) delete mode 100644 Assets/Resources/FSR2/ffx_fsr2_prepare_input_color_pass.compute delete mode 100644 Assets/Resources/FSR2/ffx_fsr2_prepare_input_color_pass.compute.meta delete mode 100644 Assets/Resources/FSR2/shaders/ffx_fsr2_prepare_input_color.h delete mode 100644 Assets/Resources/FSR2/shaders/ffx_fsr2_prepare_input_color.h.meta delete mode 100644 Assets/Resources/FSR2/shaders/ffx_fsr2_prepare_input_color_pass.hlsl delete mode 100644 Assets/Resources/FSR2/shaders/ffx_fsr2_prepare_input_color_pass.hlsl.meta diff --git a/Assets/Resources/FSR2/ffx_fsr2_prepare_input_color_pass.compute b/Assets/Resources/FSR2/ffx_fsr2_prepare_input_color_pass.compute deleted file mode 100644 index 29c9420..0000000 --- a/Assets/Resources/FSR2/ffx_fsr2_prepare_input_color_pass.compute +++ /dev/null @@ -1,14 +0,0 @@ -#pragma kernel CS - -#pragma multi_compile_local __ FFX_HALF -#pragma multi_compile_local __ FFX_FSR2_OPTION_REPROJECT_USE_LANCZOS_TYPE -#pragma multi_compile_local __ FFX_FSR2_OPTION_HDR_COLOR_INPUT -#pragma multi_compile_local __ FFX_FSR2_OPTION_LOW_RESOLUTION_MOTION_VECTORS -#pragma multi_compile_local __ FFX_FSR2_OPTION_JITTERED_MOTION_VECTORS -#pragma multi_compile_local __ FFX_FSR2_OPTION_INVERTED_DEPTH -#pragma multi_compile_local __ FFX_FSR2_OPTION_APPLY_SHARPENING - -#define FFX_GPU // Compiling for GPU -#define FFX_HLSL // Compile for plain HLSL - -#include "shaders/ffx_fsr2_prepare_input_color_pass.hlsl" diff --git a/Assets/Resources/FSR2/ffx_fsr2_prepare_input_color_pass.compute.meta b/Assets/Resources/FSR2/ffx_fsr2_prepare_input_color_pass.compute.meta deleted file mode 100644 index 898c94f..0000000 --- a/Assets/Resources/FSR2/ffx_fsr2_prepare_input_color_pass.compute.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b32b97eb4bc4e654c916f74ba1a939fc -ComputeShaderImporter: - externalObjects: {} - preprocessorOverride: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Resources/FSR2/shaders/ffx_fsr2_prepare_input_color.h b/Assets/Resources/FSR2/shaders/ffx_fsr2_prepare_input_color.h deleted file mode 100644 index a773cda..0000000 --- a/Assets/Resources/FSR2/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/Assets/Resources/FSR2/shaders/ffx_fsr2_prepare_input_color.h.meta b/Assets/Resources/FSR2/shaders/ffx_fsr2_prepare_input_color.h.meta deleted file mode 100644 index 0a5ca2d..0000000 --- a/Assets/Resources/FSR2/shaders/ffx_fsr2_prepare_input_color.h.meta +++ /dev/null @@ -1,27 +0,0 @@ -fileFormatVersion: 2 -guid: 778b4088d62d52f49acf76d0c4d97922 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Resources/FSR2/shaders/ffx_fsr2_prepare_input_color_pass.hlsl b/Assets/Resources/FSR2/shaders/ffx_fsr2_prepare_input_color_pass.hlsl deleted file mode 100644 index 942945a..0000000 --- a/Assets/Resources/FSR2/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_INPUT_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); -} diff --git a/Assets/Resources/FSR2/shaders/ffx_fsr2_prepare_input_color_pass.hlsl.meta b/Assets/Resources/FSR2/shaders/ffx_fsr2_prepare_input_color_pass.hlsl.meta deleted file mode 100644 index 1926d04..0000000 --- a/Assets/Resources/FSR2/shaders/ffx_fsr2_prepare_input_color_pass.hlsl.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 0710c8cc5e741b34882a94dddc5a1a6b -ShaderIncludeImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: