From 617cbe847209c33f83359f71ed9adc62eac16537 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Mon, 27 May 2024 11:53:53 +0200 Subject: [PATCH] Fixed a few cases of stupid, so that the RTHandle scale now actually works as it should. --- .../FidelityFX/shaders/cacao/ffx_cacao_callbacks_hlsl.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/FidelityFX/shaders/cacao/ffx_cacao_callbacks_hlsl.h b/com.unity.render-pipelines.high-definition/Runtime/FidelityFX/shaders/cacao/ffx_cacao_callbacks_hlsl.h index fb7979fd..418310ae 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/FidelityFX/shaders/cacao/ffx_cacao_callbacks_hlsl.h +++ b/com.unity.render-pipelines.high-definition/Runtime/FidelityFX/shaders/cacao/ffx_cacao_callbacks_hlsl.h @@ -430,7 +430,7 @@ float4x4 NormalsWorldToViewspaceMatrix(){ #endif } -float2 ClampAndScaleUV(float2 UV) +FfxFloat32x2 ClampAndScaleUV_HDRP(FfxFloat32x2 UV) { #if defined(CACAO_BIND_CB_CACAO) return min(UV, 1.0f) * g_FFX_CACAO_RTHandleScale.xy; @@ -669,7 +669,7 @@ void FFX_CACAO_Apply_StoreOutput(FfxUInt32x2 coord, FfxFloat32 val) FfxFloat32x4 FFX_CACAO_Prepare_SampleDepthOffsets(FfxFloat32x2 uv) { - return FFX_CACAO_Prepare_SampleDepthOffsets_Unity(ClampAndScaleUV(uv)); + return FFX_CACAO_Prepare_SampleDepthOffsets_Unity(ClampAndScaleUV_HDRP(uv)); // #if defined CACAO_BIND_SRV_DEPTH_IN // FfxFloat32x4 samples; // samples.x = g_DepthIn.SampleLevel(g_PointClampSampler, uv, 0.0f, FfxInt32x2(0, 2)); @@ -684,7 +684,7 @@ FfxFloat32x4 FFX_CACAO_Prepare_SampleDepthOffsets(FfxFloat32x2 uv) FfxFloat32x4 FFX_CACAO_Prepare_GatherDepth(FfxFloat32x2 uv) { - return FFX_CACAO_Prepare_GatherDepth_Unity(uv); + return FFX_CACAO_Prepare_GatherDepth_Unity(ClampAndScaleUV_HDRP(uv)); // #if defined CACAO_BIND_SRV_DEPTH_IN // return g_DepthIn.GatherRed(g_PointClampSampler, uv); // #else @@ -714,7 +714,7 @@ FfxFloat32 FFX_CACAO_Prepare_LoadDepthOffset(FfxUInt32x2 coord, FfxInt32x2 offse FfxFloat32x4 FFX_CACAO_Prepare_GatherDepthOffset(FfxFloat32x2 uv, FfxInt32x2 offset) { - return FFX_CACAO_Prepare_GatherDepthOffset_Unity(ClampAndScaleUV(uv), offset); + return FFX_CACAO_Prepare_GatherDepthOffset_Unity(ClampAndScaleUV_HDRP(uv), offset); // #if defined CACAO_BIND_SRV_DEPTH_IN // return g_DepthIn.GatherRed(g_PointClampSampler, uv, offset); // #else