From 61e03ec329e73dd7cb7626ebd4a371b14c74f53c Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Tue, 9 Jul 2024 22:12:05 +0200 Subject: [PATCH] Couple of minor fixes and comment changes --- Assets/Scripts/Core/Fsr3UpscalerPass.cs | 1 - Assets/Scripts/Core/Fsr3UpscalerResources.cs | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Core/Fsr3UpscalerPass.cs b/Assets/Scripts/Core/Fsr3UpscalerPass.cs index e668221..cfa2f0e 100644 --- a/Assets/Scripts/Core/Fsr3UpscalerPass.cs +++ b/Assets/Scripts/Core/Fsr3UpscalerPass.cs @@ -196,7 +196,6 @@ namespace FidelityFX commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavSpdMip3, Resources.SpdMips, 3); commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavSpdMip4, Resources.SpdMips, 4); commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavSpdMip5, Resources.SpdMips, 5); - // TODO: this seems odd to me, overwriting SpdMips before the result of the previous pass is used. Maybe it reads & writes in the above shader? Need to check. commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr3ShaderIDs.CbFsr3Upscaler, Constants, 0, Marshal.SizeOf()); commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr3ShaderIDs.CbSpd, _spdConstants, 0, Marshal.SizeOf()); diff --git a/Assets/Scripts/Core/Fsr3UpscalerResources.cs b/Assets/Scripts/Core/Fsr3UpscalerResources.cs index caac5ef..dc3c149 100644 --- a/Assets/Scripts/Core/Fsr3UpscalerResources.cs +++ b/Assets/Scripts/Core/Fsr3UpscalerResources.cs @@ -119,7 +119,7 @@ namespace FidelityFX CreateDoubleBufferedResource(InternalUpscaled, "FSR3UPSCALER_InternalUpscaled", contextDescription.MaxUpscaleSize, GraphicsFormat.R16G16B16A16_SFloat); // Resources FSR3UPSCALER_LumaHistory1/2: FFX_RESOURCE_USAGE_RENDERTARGET | FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R16G16B16A16_FLOAT, FFX_RESOURCE_FLAGS_NONE - CreateDoubleBufferedResource(LumaHistory, "FSR3UPSCALER_LumaHistory", contextDescription.MaxUpscaleSize, GraphicsFormat.R16G16B16A16_SFloat); + CreateDoubleBufferedResource(LumaHistory, "FSR3UPSCALER_LumaHistory", maxRenderSize, GraphicsFormat.R16G16B16A16_SFloat); } public void CreateTcrAutogenResources(Fsr3Upscaler.ContextDescription contextDescription) @@ -148,6 +148,7 @@ namespace FidelityFX Vector2Int maxRenderSizeDiv2 = maxRenderSize / 2; // FSR3UPSCALER_IntermediateFp16x1: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R16_FLOAT, FFX_RESOURCE_FLAGS_ALIASABLE + // TODO: see if these can be combined into one (this is a reusable temporary intermediate buffer used by different passes for different purposes) commandBuffer.GetTemporaryRT(Fsr3ShaderIDs.UavFarthestDepth, maxRenderSize.x, maxRenderSize.y, 0, default, GraphicsFormat.R16_SFloat, 1, true); commandBuffer.GetTemporaryRT(Fsr3ShaderIDs.UavLumaInstability, maxRenderSize.x, maxRenderSize.y, 0, default, GraphicsFormat.R16_SFloat, 1, true);