diff --git a/Runtime/FSR2/Fsr2.cs b/Runtime/FSR2/Fsr2.cs index 4632b96..8a2879f 100644 --- a/Runtime/FSR2/Fsr2.cs +++ b/Runtime/FSR2/Fsr2.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Nico de Poel +// Copyright (c) 2026 Nico de Poel // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -40,9 +40,8 @@ namespace FidelityFX.FSR2 else flags &= ~InitializationFlags.EnableDepthInverted; -#if UNITY_EDITOR || DEVELOPMENT_BUILD - flags |= InitializationFlags.EnableDebugChecking; -#endif + if (Debug.isDebugBuild) + flags |= InitializationFlags.EnableDebugChecking; Debug.Log($"Setting up FSR2 with render size: {maxRenderSize.x}x{maxRenderSize.y}, display size: {displaySize.x}x{displaySize.y}, flags: {flags}"); diff --git a/Runtime/FSR3/Fsr3Upscaler.cs b/Runtime/FSR3/Fsr3Upscaler.cs index 971ea28..8a7df2a 100644 --- a/Runtime/FSR3/Fsr3Upscaler.cs +++ b/Runtime/FSR3/Fsr3Upscaler.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Nico de Poel +// Copyright (c) 2026 Nico de Poel // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -39,10 +39,9 @@ namespace FidelityFX.FSR3 flags |= InitializationFlags.EnableDepthInverted; else flags &= ~InitializationFlags.EnableDepthInverted; - -#if UNITY_EDITOR || DEVELOPMENT_BUILD - flags |= InitializationFlags.EnableDebugChecking; -#endif + + if (Debug.isDebugBuild) + flags |= InitializationFlags.EnableDebugChecking; Debug.Log($"Setting up FSR3 Upscaler with render size: {maxRenderSize.x}x{maxRenderSize.y}, display size: {displaySize.x}x{displaySize.y}, flags: {flags}"); diff --git a/Runtime/FSR3/Fsr3UpscalerContext.cs b/Runtime/FSR3/Fsr3UpscalerContext.cs index c82e60d..bdbedbf 100644 --- a/Runtime/FSR3/Fsr3UpscalerContext.cs +++ b/Runtime/FSR3/Fsr3UpscalerContext.cs @@ -48,9 +48,7 @@ namespace FidelityFX.FSR3 private Fsr3UpscalerPass _sharpenPass; private Fsr3UpscalerPass _generateReactivePass; private Fsr3UpscalerPass _tcrAutogeneratePass; -#if UNITY_EDITOR || DEVELOPMENT_BUILD private Fsr3UpscalerPass _debugViewPass; -#endif private readonly Fsr3UpscalerResources _resources = new Fsr3UpscalerResources(); @@ -118,16 +116,12 @@ namespace FidelityFX.FSR3 _sharpenPass = new Fsr3UpscalerSharpenPass(_contextDescription, _resources, _upscalerConstantsBuffer, _rcasConstantsBuffer); _generateReactivePass = new Fsr3UpscalerGenerateReactivePass(_contextDescription, _resources, _generateReactiveConstantsBuffer); _tcrAutogeneratePass = new Fsr3UpscalerTcrAutogeneratePass(_contextDescription, _resources, _upscalerConstantsBuffer, _tcrAutogenerateConstantsBuffer); -#if UNITY_EDITOR || DEVELOPMENT_BUILD _debugViewPass = new Fsr3UpscalerDebugViewPass(_contextDescription, _resources, _upscalerConstantsBuffer); -#endif } public void Destroy() { -#if UNITY_EDITOR || DEVELOPMENT_BUILD DestroyPass(ref _debugViewPass); -#endif DestroyPass(ref _tcrAutogeneratePass); DestroyPass(ref _generateReactivePass); DestroyPass(ref _lumaPyramidPass); @@ -289,12 +283,10 @@ namespace FidelityFX.FSR3 _sharpenPass.ScheduleDispatch(commandBuffer, dispatchParams, frameIndex, threadGroupsX, threadGroupsY); } -#if UNITY_EDITOR || DEVELOPMENT_BUILD if ((dispatchParams.Flags & Fsr3Upscaler.DispatchFlags.DrawDebugView) != 0) { _debugViewPass.ScheduleDispatch(commandBuffer, dispatchParams, frameIndex, dispatchDstX, dispatchDstY); } -#endif _resourceFrameIndex = (_resourceFrameIndex + 1) % MaxQueuedFrames; diff --git a/Runtime/FSR3/Fsr3UpscalerPass.cs b/Runtime/FSR3/Fsr3UpscalerPass.cs index af4ecc2..10d4583 100644 --- a/Runtime/FSR3/Fsr3UpscalerPass.cs +++ b/Runtime/FSR3/Fsr3UpscalerPass.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Nico de Poel +// Copyright (c) 2026 Nico de Poel // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -457,7 +457,6 @@ namespace FidelityFX.FSR3 } } -#if UNITY_EDITOR || DEVELOPMENT_BUILD internal class Fsr3UpscalerDebugViewPass : Fsr3UpscalerPass { public Fsr3UpscalerDebugViewPass(Fsr3Upscaler.ContextDescription contextDescription, Fsr3UpscalerResources resources, ComputeBuffer constants) @@ -483,5 +482,4 @@ namespace FidelityFX.FSR3 commandBuffer.DispatchCompute(ComputeShader, KernelIndex, dispatchX, dispatchY, 1); } } -#endif } diff --git a/Runtime/FidelityFX.FSR.asmdef b/Runtime/FidelityFX.FSR.asmdef index 4d4ce4c..28ddc72 100644 --- a/Runtime/FidelityFX.FSR.asmdef +++ b/Runtime/FidelityFX.FSR.asmdef @@ -1,7 +1,9 @@ { "name": "FidelityFX.FSR", "rootNamespace": "FidelityFX", - "references": [], + "references": [ + "GUID:df380645f10b7bc4b97d4f5eb6303d95" + ], "includePlatforms": [], "excludePlatforms": [], "allowUnsafeCode": false, diff --git a/Shaders/ffx_fsr3upscaler_accumulate_pass.compute b/Shaders/ffx_fsr3upscaler_accumulate_pass.compute index bc0b1b7..4e031ce 100644 --- a/Shaders/ffx_fsr3upscaler_accumulate_pass.compute +++ b/Shaders/ffx_fsr3upscaler_accumulate_pass.compute @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Nico de Poel +// Copyright (c) 2026 Nico de Poel // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,7 @@ #pragma multi_compile __ UNITY_FSR_TEXTURE2D_X_ARRAY -#include "ffx_fsr_unity_common.cginc" +#include_with_pragmas "ffx_fsr_unity_common.cginc" // Ensure the correct value is defined for this keyword, as it is used to select one of multiple sampler functions #ifdef FFX_FSR3UPSCALER_OPTION_REPROJECT_USE_LANCZOS_TYPE diff --git a/Shaders/ffx_fsr3upscaler_autogen_reactive_pass.compute b/Shaders/ffx_fsr3upscaler_autogen_reactive_pass.compute index 500352a..4064b2b 100644 --- a/Shaders/ffx_fsr3upscaler_autogen_reactive_pass.compute +++ b/Shaders/ffx_fsr3upscaler_autogen_reactive_pass.compute @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Nico de Poel +// Copyright (c) 2026 Nico de Poel // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -24,6 +24,6 @@ #pragma multi_compile __ UNITY_FSR_TEXTURE2D_X_ARRAY -#include "ffx_fsr_unity_common.cginc" +#include_with_pragmas "ffx_fsr_unity_common.cginc" #include "shaders/ffx_fsr3upscaler_autogen_reactive_pass.hlsl" diff --git a/Shaders/ffx_fsr3upscaler_debug_view_pass.compute b/Shaders/ffx_fsr3upscaler_debug_view_pass.compute index 027e414..4bf51b7 100644 --- a/Shaders/ffx_fsr3upscaler_debug_view_pass.compute +++ b/Shaders/ffx_fsr3upscaler_debug_view_pass.compute @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Nico de Poel +// Copyright (c) 2026 Nico de Poel // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -24,6 +24,6 @@ #pragma multi_compile __ UNITY_FSR_TEXTURE2D_X_ARRAY -#include "ffx_fsr_unity_common.cginc" +#include_with_pragmas "ffx_fsr_unity_common.cginc" #include "shaders/ffx_fsr3upscaler_debug_view_pass.hlsl" diff --git a/Shaders/ffx_fsr3upscaler_luma_instability_pass.compute b/Shaders/ffx_fsr3upscaler_luma_instability_pass.compute index 5cffc66..af98e26 100644 --- a/Shaders/ffx_fsr3upscaler_luma_instability_pass.compute +++ b/Shaders/ffx_fsr3upscaler_luma_instability_pass.compute @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Nico de Poel +// Copyright (c) 2026 Nico de Poel // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -24,6 +24,6 @@ #pragma multi_compile __ UNITY_FSR_TEXTURE2D_X_ARRAY -#include "ffx_fsr_unity_common.cginc" +#include_with_pragmas "ffx_fsr_unity_common.cginc" #include "shaders/ffx_fsr3upscaler_luma_instability_pass.hlsl" diff --git a/Shaders/ffx_fsr3upscaler_luma_pyramid_pass.compute b/Shaders/ffx_fsr3upscaler_luma_pyramid_pass.compute index 347b0d6..7fcf588 100644 --- a/Shaders/ffx_fsr3upscaler_luma_pyramid_pass.compute +++ b/Shaders/ffx_fsr3upscaler_luma_pyramid_pass.compute @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Nico de Poel +// Copyright (c) 2026 Nico de Poel // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -24,7 +24,7 @@ #pragma multi_compile __ UNITY_FSR_TEXTURE2D_X_ARRAY -#include "ffx_fsr_unity_common.cginc" +#include_with_pragmas "ffx_fsr_unity_common.cginc" // Wave operations require shader model 6.0; this can only be enabled when using DXC on D3D12 // These pragmas are commented out by default as Unity will sometimes ignore the #if's and try to enable these features anyway. diff --git a/Shaders/ffx_fsr3upscaler_prepare_inputs_pass.compute b/Shaders/ffx_fsr3upscaler_prepare_inputs_pass.compute index b71ea5d..b00e042 100644 --- a/Shaders/ffx_fsr3upscaler_prepare_inputs_pass.compute +++ b/Shaders/ffx_fsr3upscaler_prepare_inputs_pass.compute @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Nico de Poel +// Copyright (c) 2026 Nico de Poel // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -26,6 +26,6 @@ #pragma multi_compile __ UNITY_FSR_TEXTURE2D_X_ARRAY -#include "ffx_fsr_unity_common.cginc" +#include_with_pragmas "ffx_fsr_unity_common.cginc" #include "shaders/ffx_fsr3upscaler_prepare_inputs_pass.hlsl" diff --git a/Shaders/ffx_fsr3upscaler_prepare_reactivity_pass.compute b/Shaders/ffx_fsr3upscaler_prepare_reactivity_pass.compute index ebf4e91..8db7464 100644 --- a/Shaders/ffx_fsr3upscaler_prepare_reactivity_pass.compute +++ b/Shaders/ffx_fsr3upscaler_prepare_reactivity_pass.compute @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Nico de Poel +// Copyright (c) 2026 Nico de Poel // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -24,6 +24,6 @@ #pragma multi_compile __ UNITY_FSR_TEXTURE2D_X_ARRAY -#include "ffx_fsr_unity_common.cginc" +#include_with_pragmas "ffx_fsr_unity_common.cginc" #include "shaders/ffx_fsr3upscaler_prepare_reactivity_pass.hlsl" diff --git a/Shaders/ffx_fsr3upscaler_rcas_pass.compute b/Shaders/ffx_fsr3upscaler_rcas_pass.compute index 282a9ae..222710e 100644 --- a/Shaders/ffx_fsr3upscaler_rcas_pass.compute +++ b/Shaders/ffx_fsr3upscaler_rcas_pass.compute @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Nico de Poel +// Copyright (c) 2026 Nico de Poel // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -22,6 +22,6 @@ #pragma multi_compile __ UNITY_FSR_TEXTURE2D_X_ARRAY -#include "ffx_fsr_unity_common.cginc" +#include_with_pragmas "ffx_fsr_unity_common.cginc" #include "shaders/ffx_fsr3upscaler_rcas_pass.hlsl" diff --git a/Shaders/ffx_fsr3upscaler_shading_change_pass.compute b/Shaders/ffx_fsr3upscaler_shading_change_pass.compute index 34c3ade..8c76810 100644 --- a/Shaders/ffx_fsr3upscaler_shading_change_pass.compute +++ b/Shaders/ffx_fsr3upscaler_shading_change_pass.compute @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Nico de Poel +// Copyright (c) 2026 Nico de Poel // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -24,6 +24,6 @@ #pragma multi_compile __ UNITY_FSR_TEXTURE2D_X_ARRAY -#include "ffx_fsr_unity_common.cginc" +#include_with_pragmas "ffx_fsr_unity_common.cginc" #include "shaders/ffx_fsr3upscaler_shading_change_pass.hlsl" diff --git a/Shaders/ffx_fsr3upscaler_shading_change_pyramid_pass.compute b/Shaders/ffx_fsr3upscaler_shading_change_pyramid_pass.compute index ffe5bfe..916244a 100644 --- a/Shaders/ffx_fsr3upscaler_shading_change_pyramid_pass.compute +++ b/Shaders/ffx_fsr3upscaler_shading_change_pyramid_pass.compute @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Nico de Poel +// Copyright (c) 2026 Nico de Poel // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -24,7 +24,7 @@ #pragma multi_compile __ UNITY_FSR_TEXTURE2D_X_ARRAY -#include "ffx_fsr_unity_common.cginc" +#include_with_pragmas "ffx_fsr_unity_common.cginc" // Wave operations require shader model 6.0; this can only be enabled when using DXC on D3D12 #define FFX_SPD_NO_WAVE_OPERATIONS diff --git a/Shaders/ffx_fsr3upscaler_tcr_autogen_pass.compute b/Shaders/ffx_fsr3upscaler_tcr_autogen_pass.compute index 952c052..df86337 100644 --- a/Shaders/ffx_fsr3upscaler_tcr_autogen_pass.compute +++ b/Shaders/ffx_fsr3upscaler_tcr_autogen_pass.compute @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Nico de Poel +// Copyright (c) 2026 Nico de Poel // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -25,6 +25,6 @@ #pragma multi_compile __ UNITY_FSR_TEXTURE2D_X_ARRAY -#include "ffx_fsr_unity_common.cginc" +#include_with_pragmas "ffx_fsr_unity_common.cginc" #include "shaders/ffx_fsr3upscaler_tcr_autogen_pass.hlsl" diff --git a/Shaders/ffx_fsr_unity_common.cginc b/Shaders/ffx_fsr_unity_common.cginc index 7703535..f1681f3 100644 --- a/Shaders/ffx_fsr_unity_common.cginc +++ b/Shaders/ffx_fsr_unity_common.cginc @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Nico de Poel +// Copyright (c) 2026 Nico de Poel // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal