4 Commits

  1. 9
      Runtime/FSR2/Fsr2Context.cs
  2. 6
      Runtime/FSR2/Fsr2Pass.cs
  3. 11
      Runtime/FSR2/Fsr2Resources.cs
  4. 1
      Runtime/FSR2/Fsr2ShaderIDs.cs
  5. 9
      Runtime/FSR3/Fsr3UpscalerContext.cs
  6. 6
      Runtime/FSR3/Fsr3UpscalerPass.cs
  7. 7
      Runtime/FSR3/Fsr3UpscalerResources.cs
  8. 4
      Shaders/shaders/ffx_fsr2_accumulate_pass.hlsl
  9. 1
      Shaders/shaders/ffx_fsr2_compute_luminance_pyramid_pass.hlsl
  10. 2
      Shaders/shaders/ffx_fsr3upscaler_accumulate_pass.hlsl
  11. 1
      Shaders/shaders/ffx_fsr3upscaler_luma_pyramid_pass.hlsl
  12. 2
      Shaders/shaders/fsr2/ffx_fsr2_accumulate.h
  13. 4
      Shaders/shaders/fsr2/ffx_fsr2_callbacks_hlsl.h
  14. 2
      Shaders/shaders/fsr2/ffx_fsr2_compute_luminance_pyramid.h
  15. 2
      Shaders/shaders/fsr2/ffx_fsr2_reproject.h
  16. 4
      Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_accumulate.h
  17. 4
      Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_luma_pyramid.h

9
Runtime/FSR2/Fsr2Context.cs

@ -163,7 +163,7 @@ namespace FidelityFX.FSR2
// If auto exposure is enabled use the auto exposure SRV, otherwise what the app sends
if ((_contextDescription.Flags & Fsr2.InitializationFlags.EnableAutoExposure) != 0)
dispatchParams.Exposure = new ResourceView(_resources.AutoExposure);
dispatchParams.Exposure = new ResourceView(_resources.AutoExposure[frameIndex]);
else if (!dispatchParams.Exposure.IsValid)
dispatchParams.Exposure = new ResourceView(_resources.DefaultExposure);
@ -211,8 +211,8 @@ namespace FidelityFX.FSR2
commandBuffer.ClearRenderTarget(false, true, Color.clear);
// Auto exposure always used to track luma changes in locking logic
commandBuffer.SetRenderTarget(_resources.AutoExposure);
commandBuffer.ClearRenderTarget(false, true, new Color(0f, 1f, 0f, 0f));
commandBuffer.SetRenderTarget(_resources.AutoExposure[frameIndex ^ 1]);
commandBuffer.ClearRenderTarget(false, true, new Color(0f, 1e8f, 0f, 0f));
// Reset atomic counter to 0
commandBuffer.SetRenderTarget(_resources.SpdAtomicCounter);
@ -224,6 +224,9 @@ namespace FidelityFX.FSR2
commandBuffer.SetRenderTarget(Fsr2ShaderIDs.UavReconstructedPrevNearestDepth);
commandBuffer.ClearRenderTarget(false, true, depthInverted ? Color.clear : Color.white);
commandBuffer.SetRenderTarget(Fsr2ShaderIDs.UavNewLocks);
commandBuffer.ClearRenderTarget(false, true, Color.clear);
// Auto exposure
SetupSpdConstants(dispatchParams, out var dispatchThreadGroupCount);

6
Runtime/FSR2/Fsr2Pass.cs

@ -127,11 +127,12 @@ namespace FidelityFX.FSR2
{
ref var color = ref dispatchParams.Color;
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvInputColor, color.RenderTarget, color.MipLevel, color.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvAutoExposure, Resources.AutoExposure[frameIndex ^ 1]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.UavSpdAtomicCount, Resources.SpdAtomicCounter);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.UavExposureMipLumaChange, Resources.SceneLuminance, ShadingChangeMipLevel);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.UavExposureMip5, Resources.SceneLuminance, 5);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.UavAutoExposure, Resources.AutoExposure);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.UavAutoExposure, Resources.AutoExposure[frameIndex]);
commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr2ShaderIDs.CbFsr2, Constants, 0, Marshal.SizeOf<Fsr2.UpscalerConstants>());
commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr2ShaderIDs.CbSpd, _spdConstants, 0, Marshal.SizeOf<Fsr2.SpdConstants>());
@ -271,8 +272,9 @@ namespace FidelityFX.FSR2
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvLanczosLut, Resources.LanczosLut);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvUpscaleMaximumBiasLut, Resources.MaximumBiasLut);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvSceneLuminanceMips, Resources.SceneLuminance);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvAutoExposure, Resources.AutoExposure);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvAutoExposure, Resources.AutoExposure[frameIndex]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvLumaHistory, Resources.LumaHistory[frameIndex ^ 1]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvNewLocks, Fsr2ShaderIDs.UavNewLocks);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.UavInternalUpscaled, Resources.InternalUpscaled[frameIndex]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.UavLockStatus, Resources.LockStatus[frameIndex]);

11
Runtime/FSR2/Fsr2Resources.cs

@ -36,10 +36,10 @@ namespace FidelityFX.FSR2
public Texture2D LanczosLut;
public Texture2D MaximumBiasLut;
public RenderTexture SpdAtomicCounter;
public RenderTexture AutoExposure;
public RenderTexture SceneLuminance;
public RenderTexture AutoReactive;
public RenderTexture AutoComposition;
public readonly RenderTexture[] AutoExposure = new RenderTexture[2];
public readonly RenderTexture[] DilatedMotionVectors = new RenderTexture[2];
public readonly RenderTexture[] LockStatus = new RenderTexture[2];
public readonly RenderTexture[] InternalUpscaled = new RenderTexture[2];
@ -91,10 +91,6 @@ namespace FidelityFX.FSR2
SpdAtomicCounter = new RenderTexture(1, 1, 0, GraphicsFormat.R32_UInt) { name = "FSR2_SpdAtomicCounter", enableRandomWrite = true };
SpdAtomicCounter.Create();
// Resource FSR2_AutoExposure: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R32G32_FLOAT, FFX_RESOURCE_FLAGS_NONE
AutoExposure = new RenderTexture(1, 1, 0, GraphicsFormat.R32G32_SFloat) { name = "FSR2_AutoExposure", enableRandomWrite = true };
AutoExposure.Create();
// Resource FSR2_ExposureMips: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R16_FLOAT, FFX_RESOURCE_FLAGS_ALIASABLE
// This is a rather special case: it's an aliasable resource, but because we require a mipmap chain and bind specific mip levels per shader, we can't easily use temporary RTs for this.
int w = contextDescription.MaxRenderSize.x / 2, h = contextDescription.MaxRenderSize.y / 2;
@ -102,6 +98,9 @@ namespace FidelityFX.FSR2
SceneLuminance = new RenderTexture(w, h, 0, GraphicsFormat.R16_SFloat, mipCount) { name = "FSR2_ExposureMips", enableRandomWrite = true, useMipMap = true, autoGenerateMips = false };
SceneLuminance.Create();
// Resource FSR2_AutoExposure: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R32G32_FLOAT, FFX_RESOURCE_FLAGS_NONE
CreateDoubleBufferedResource(AutoExposure, "FSR2_AutoExposure", Vector2Int.one, GraphicsFormat.R32G32_SFloat);
// Resources FSR2_InternalDilatedVelocity1/2: FFX_RESOURCE_USAGE_RENDERTARGET | FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R16G16_FLOAT, FFX_RESOURCE_FLAGS_NONE
CreateDoubleBufferedResource(DilatedMotionVectors, "FSR2_InternalDilatedVelocity", contextDescription.MaxRenderSize, GraphicsFormat.R16G16_SFloat);
@ -186,8 +185,8 @@ namespace FidelityFX.FSR2
DestroyResource(InternalUpscaled);
DestroyResource(LockStatus);
DestroyResource(DilatedMotionVectors);
DestroyResource(AutoExposure);
DestroyResource(ref SceneLuminance);
DestroyResource(ref AutoExposure);
DestroyResource(ref DefaultReactive);
DestroyResource(ref DefaultExposure);
DestroyResource(ref MaximumBiasLut);

1
Runtime/FSR2/Fsr2ShaderIDs.cs

@ -39,6 +39,7 @@ namespace FidelityFX.FSR2
public static readonly int SrvDilatedDepth = Shader.PropertyToID("r_dilatedDepth");
public static readonly int SrvInternalUpscaled = Shader.PropertyToID("r_internal_upscaled_color");
public static readonly int SrvLockStatus = Shader.PropertyToID("r_lock_status");
public static readonly int SrvNewLocks = Shader.PropertyToID("r_new_locks");
public static readonly int SrvLockInputLuma = Shader.PropertyToID("r_lock_input_luma");
public static readonly int SrvPreparedInputColor = Shader.PropertyToID("r_prepared_input_color");
public static readonly int SrvLumaHistory = Shader.PropertyToID("r_luma_history");

9
Runtime/FSR3/Fsr3UpscalerContext.cs

@ -189,7 +189,7 @@ namespace FidelityFX.FSR3
// If auto exposure is enabled use the auto exposure SRV, otherwise what the app sends
if ((_contextDescription.Flags & Fsr3Upscaler.InitializationFlags.EnableAutoExposure) != 0)
dispatchParams.Exposure = new ResourceView(_resources.FrameInfo);
dispatchParams.Exposure = new ResourceView(_resources.FrameInfo[frameIndex]);
else if (!dispatchParams.Exposure.IsValid)
dispatchParams.Exposure = new ResourceView(_resources.DefaultExposure);
@ -236,8 +236,8 @@ namespace FidelityFX.FSR3
commandBuffer.ClearRenderTarget(false, true, Color.clear);
// Auto exposure always used to track luma changes in locking logic
commandBuffer.SetRenderTarget(_resources.FrameInfo);
commandBuffer.ClearRenderTarget(false, true, new Color(0f, 1f, 0f, 0f));
commandBuffer.SetRenderTarget(_resources.FrameInfo[frameIndex ^ 1]);
commandBuffer.ClearRenderTarget(false, true, new Color(0f, 1e8f, 0f, 0f));
// Reset atomic counter to 0
commandBuffer.SetRenderTarget(_resources.SpdAtomicCounter);
@ -249,6 +249,9 @@ namespace FidelityFX.FSR3
commandBuffer.SetRenderTarget(_resources.ReconstructedPrevNearestDepth);
commandBuffer.ClearRenderTarget(false, true, depthInverted ? Color.clear : Color.white);
commandBuffer.SetRenderTarget(Fsr3ShaderIDs.UavNewLocks);
commandBuffer.ClearRenderTarget(false, true, Color.clear);
// Auto exposure
SetupSpdConstants(dispatchParams, out var dispatchThreadGroupCount);

6
Runtime/FSR3/Fsr3UpscalerPass.cs

@ -155,9 +155,10 @@ namespace FidelityFX.FSR3
{
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvCurrentLuma, Resources.Luma[frameIndex]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvFarthestDepth, Fsr3ShaderIDs.UavIntermediate);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvFrameInfo, Resources.FrameInfo[frameIndex ^ 1]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavSpdAtomicCount, Resources.SpdAtomicCounter);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavFrameInfo, Resources.FrameInfo);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavFrameInfo, Resources.FrameInfo[frameIndex]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavSpdMip0, Resources.SpdMips, 0);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavSpdMip1, Resources.SpdMips, 1);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavSpdMip2, Resources.SpdMips, 2);
@ -273,7 +274,7 @@ namespace FidelityFX.FSR3
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvInputExposure, exposure.RenderTarget, exposure.MipLevel, exposure.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvDilatedReactiveMasks, Fsr3ShaderIDs.UavDilatedReactiveMasks);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvDilatedMotionVectors, Resources.DilatedVelocity);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvFrameInfo, Resources.FrameInfo);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvFrameInfo, Resources.FrameInfo[frameIndex]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvLumaHistory, Resources.LumaHistory[frameIndex ^ 1]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvFarthestDepthMip1, Fsr3ShaderIDs.UavFarthestDepthMip1);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvCurrentLuma, Resources.Luma[frameIndex]);
@ -341,6 +342,7 @@ namespace FidelityFX.FSR3
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvCurrentLuma, Resources.Luma[frameIndex]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvLumaInstability, Fsr3ShaderIDs.UavIntermediate);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvInputColor, color.RenderTarget, color.MipLevel, color.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvNewLocks, Fsr3ShaderIDs.UavNewLocks);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavInternalUpscaled, Resources.InternalUpscaled[frameIndex]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavUpscaledOutput, output.RenderTarget, output.MipLevel, output.SubElement);

7
Runtime/FSR3/Fsr3UpscalerResources.cs

@ -40,10 +40,10 @@ namespace FidelityFX.FSR3
public RenderTexture DilatedVelocity;
public RenderTexture DilatedDepth;
public RenderTexture ReconstructedPrevNearestDepth;
public RenderTexture FrameInfo;
public RenderTexture AutoReactive;
public RenderTexture AutoComposition;
public readonly RenderTexture[] FrameInfo = new RenderTexture[2];
public readonly RenderTexture[] Accumulation = new RenderTexture[2];
public readonly RenderTexture[] Luma = new RenderTexture[2];
public readonly RenderTexture[] InternalUpscaled = new RenderTexture[2];
@ -106,8 +106,7 @@ namespace FidelityFX.FSR3
ReconstructedPrevNearestDepth.Create();
// Resource FSR3UPSCALER_FrameInfo: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R32G32B32A32_FLOAT, FFX_RESOURCE_FLAGS_NONE
FrameInfo = new RenderTexture(1, 1, 0, GraphicsFormat.R32G32B32A32_SFloat) { name = "FSR3UPSCALER_FrameInfo", enableRandomWrite = true };
FrameInfo.Create();
CreateDoubleBufferedResource(FrameInfo, "FSR3UPSCALER_FrameInfo", Vector2Int.one, GraphicsFormat.R32G32B32A32_SFloat);
// Resources FSR3UPSCALER_Accumulation1/2: FFX_RESOURCE_USAGE_RENDERTARGET | FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R8_UNORM, FFX_RESOURCE_FLAGS_NONE
CreateDoubleBufferedResource(Accumulation, "FSR3UPSCALER_Accumulation", maxRenderSize, GraphicsFormat.R8_UNorm);
@ -190,8 +189,8 @@ namespace FidelityFX.FSR3
DestroyResource(InternalUpscaled);
DestroyResource(Luma);
DestroyResource(Accumulation);
DestroyResource(FrameInfo);
DestroyResource(ref FrameInfo);
DestroyResource(ref ReconstructedPrevNearestDepth);
DestroyResource(ref DilatedDepth);
DestroyResource(ref DilatedVelocity);

4
Shaders/shaders/ffx_fsr2_accumulate_pass.hlsl

@ -35,12 +35,12 @@
#define FSR2_BIND_SRV_SCENE_LUMINANCE_MIPS 8
#define FSR2_BIND_SRV_AUTO_EXPOSURE 9
#define FSR2_BIND_SRV_LUMA_HISTORY 10
#define FSR2_BIND_SRV_NEW_LOCKS 11
#define FSR2_BIND_UAV_INTERNAL_UPSCALED 0
#define FSR2_BIND_UAV_LOCK_STATUS 1
#define FSR2_BIND_UAV_UPSCALED_OUTPUT 2
#define FSR2_BIND_UAV_NEW_LOCKS 3
#define FSR2_BIND_UAV_LUMA_HISTORY 4
#define FSR2_BIND_UAV_LUMA_HISTORY 3
#define FSR2_BIND_CB_FSR2 0

1
Shaders/shaders/ffx_fsr2_compute_luminance_pyramid_pass.hlsl

@ -21,6 +21,7 @@
// THE SOFTWARE.
#define FSR2_BIND_SRV_INPUT_COLOR 0
#define FSR2_BIND_SRV_AUTO_EXPOSURE 1
#define FSR2_BIND_UAV_SPD_GLOBAL_ATOMIC 0
#define FSR2_BIND_UAV_EXPOSURE_MIP_LUMA_CHANGE 1

2
Shaders/shaders/ffx_fsr3upscaler_accumulate_pass.hlsl

@ -34,10 +34,10 @@
#define FSR3UPSCALER_BIND_SRV_CURRENT_LUMA 6
#define FSR3UPSCALER_BIND_SRV_LUMA_INSTABILITY 7
#define FSR3UPSCALER_BIND_SRV_INPUT_COLOR 8
#define FSR3UPSCALER_BIND_SRV_NEW_LOCKS 9
#define FSR3UPSCALER_BIND_UAV_INTERNAL_UPSCALED 0
#define FSR3UPSCALER_BIND_UAV_UPSCALED_OUTPUT 1
#define FSR3UPSCALER_BIND_UAV_NEW_LOCKS 2
#define FSR3UPSCALER_BIND_CB_FSR3UPSCALER 0

1
Shaders/shaders/ffx_fsr3upscaler_luma_pyramid_pass.hlsl

@ -22,6 +22,7 @@
#define FSR3UPSCALER_BIND_SRV_CURRENT_LUMA 0
#define FSR3UPSCALER_BIND_SRV_FARTHEST_DEPTH 1
#define FSR3UPSCALER_BIND_SRV_FRAME_INFO 2
#define FSR3UPSCALER_BIND_UAV_SPD_GLOBAL_ATOMIC 0
#define FSR3UPSCALER_BIND_UAV_FRAME_INFO 1

2
Shaders/shaders/fsr2/ffx_fsr2_accumulate.h

@ -289,7 +289,7 @@ void Accumulate(FfxInt32x2 iPxHrPos)
#if FFX_FSR2_OPTION_APPLY_SHARPENING == 0
WriteUpscaledOutput(iPxHrPos, fHistoryColor);
#endif
StoreNewLocks(iPxHrPos, 0);
//StoreNewLocks(iPxHrPos, 0);
}
#endif // FFX_FSR2_ACCUMULATE_H

4
Shaders/shaders/fsr2/ffx_fsr2_callbacks_hlsl.h

@ -908,7 +908,9 @@ void StorePrevPostAlpha(FFX_PARAMETER_IN FFX_MIN16_I2 iPxPos, FFX_PARAMETER_IN F
FfxFloat32x2 SPD_LoadExposureBuffer()
{
#if defined FSR2_BIND_UAV_AUTO_EXPOSURE
#if defined FSR2_BIND_SRV_AUTO_EXPOSURE
return r_auto_exposure[FfxInt32x2(0, 0)];
#elif defined FSR2_BIND_UAV_AUTO_EXPOSURE
return rw_auto_exposure[FfxInt32x2(0, 0)];
#else
return FfxFloat32x2(0.f, 0.f);

2
Shaders/shaders/fsr2/ffx_fsr2_compute_luminance_pyramid.h

@ -20,7 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
FFX_GROUPSHARED FfxUInt32 spdCounter;
FFX_GROUPSHARED FfxUInt32 spdCounter = 0u;
void SpdIncreaseAtomicCounter(FfxUInt32 slice)
{

2
Shaders/shaders/fsr2/ffx_fsr2_reproject.h

@ -120,7 +120,7 @@ void ReprojectHistoryColor(const AccumulationPassCommonParams params, FFX_PARAME
LockState ReprojectHistoryLockStatus(const AccumulationPassCommonParams params, FFX_PARAMETER_OUT FfxFloat32x2 fReprojectedLockStatus)
{
LockState state = { FFX_FALSE, FFX_FALSE };
const FfxFloat32 fNewLockIntensity = LoadRwNewLocks(params.iPxHrPos);
const FfxFloat32 fNewLockIntensity = LoadNewLocks(params.iPxHrPos);
state.NewLock = fNewLockIntensity > (127.0f / 255.0f);
FfxFloat32 fInPlaceLockLifetime = state.NewLock ? fNewLockIntensity : 0;

4
Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_accumulate.h

@ -79,7 +79,7 @@ void UpdateLockStatus(AccumulationPassCommonParams params, FFX_PARAMETER_INOUT A
// Compute this frame lock contribution
data.fLockContributionThisFrame = ffxSaturate(ffxSaturate(data.fLock - fLockThreshold) * (fLockMax - fLockThreshold));
const FfxFloat32 fNewLockIntensity = LoadRwNewLocks(params.iPxHrPos) * (1.0f - ffxMax(params.fShadingChange * 0, params.fReactiveMask));
const FfxFloat32 fNewLockIntensity = LoadNewLocks(params.iPxHrPos) * (1.0f - ffxMax(params.fShadingChange * 0, params.fReactiveMask));
data.fLock = ffxMax(0.0f, ffxMin(data.fLock + fNewLockIntensity, fLockMax));
// Preparing for next frame
@ -169,5 +169,5 @@ void Accumulate(FfxInt32x2 iPxHrPos)
#if FFX_FSR3UPSCALER_OPTION_APPLY_SHARPENING == 0
StoreUpscaledOutput(iPxHrPos, data.fHistoryColor);
#endif
StoreNewLocks(iPxHrPos, 0);
//StoreNewLocks(iPxHrPos, 0);
}

4
Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_luma_pyramid.h

@ -20,7 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
FFX_GROUPSHARED FfxUInt32 spdCounter;
FFX_GROUPSHARED FfxUInt32 spdCounter = 0u;
void SpdIncreaseAtomicCounter(FfxUInt32 slice)
{
@ -95,7 +95,7 @@ void SpdStore(FfxInt32x2 pix, FfxFloat32x4 outValue, FfxUInt32 index, FfxUInt32
if (all(FFX_EQUAL(pix, FfxInt32x2(0, 0))))
{
FfxFloat32x4 frameInfo = LoadFrameInfo();
FfxFloat32x4 frameInfo = FrameInfo();
const FfxFloat32 fSceneAvgLuma = outValue[LUMA];
const FfxFloat32 fPrevLogLuma = frameInfo[FRAME_INFO_LOG_LUMA];
FfxFloat32 fLogLuma = outValue[LOG_LUMA];

Loading…
Cancel
Save