Browse Source

Updated SuperResolution shaders and code to FSR3

fsr3
Nico de Poel 2 years ago
parent
commit
c71e487b15
  1. 2
      Assets/Scenes/SampleScenePPV2.unity
  2. 6
      Assets/Scripts/DebugDumper.cs
  3. 2
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/PostProcessLayerEditor.cs
  4. 67
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/PostProcessResources.asset
  5. 92
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/SuperResolution.cs
  6. 3
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR2/Fsr2.cs.meta
  7. 3
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR2/Fsr2Context.cs.meta
  8. 3
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR2/Fsr2Pass.cs.meta
  9. 3
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR2/Fsr2Resources.cs.meta
  10. 3
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR2/Fsr2ShaderIDs.cs.meta
  11. 2
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3.meta
  12. 8
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3ShaderIDs.cs
  13. 3
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3ShaderIDs.cs.meta
  14. 31
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3Upscaler.cs
  15. 3
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3Upscaler.cs.meta
  16. 22
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerCallbacks.cs
  17. 2
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerCallbacks.cs.meta
  18. 208
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerContext.cs
  19. 3
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerContext.cs.meta
  20. 250
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerPass.cs
  21. 3
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerPass.cs.meta
  22. 110
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerResources.cs
  23. 3
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerResources.cs.meta
  24. 2
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessLayer.cs
  25. 8
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/ffx_fsr2_lock_pass.compute.meta
  26. 8
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/ffx_fsr2_rcas_pass.compute.meta
  27. 8
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/ffx_fsr2_reconstruct_previous_depth_pass.compute.meta
  28. 8
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/ffx_fsr2_tcr_autogen_pass.compute.meta
  29. 60
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_common_types.h.meta
  30. 60
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_core.h.meta
  31. 60
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_core_cpu.h.meta
  32. 60
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_core_gpu_common.h.meta
  33. 60
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_core_gpu_common_half.h.meta
  34. 60
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_core_hlsl.h.meta
  35. 60
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_core_portability.h.meta
  36. 60
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr1.h.meta
  37. 60
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_accumulate.h.meta
  38. 78
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_accumulate_pass.hlsl
  39. 85
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_autogen_reactive_pass.hlsl
  40. 817
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_callbacks_hlsl.h
  41. 60
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_callbacks_hlsl.h.meta
  42. 60
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_common.h.meta
  43. 60
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_compute_luminance_pyramid.h.meta
  44. 131
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_compute_luminance_pyramid_pass.hlsl
  45. 60
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_depth_clip.h.meta
  46. 66
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_depth_clip_pass.hlsl
  47. 60
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_lock.h.meta
  48. 53
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_lock_pass.hlsl
  49. 7
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_lock_pass.hlsl.meta
  50. 60
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_postprocess_lock_status.h.meta
  51. 60
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_rcas.h.meta
  52. 75
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_rcas_pass.hlsl
  53. 7
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_rcas_pass.hlsl.meta
  54. 60
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_reconstruct_dilated_velocity_and_previous_depth.h.meta
  55. 63
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_reconstruct_previous_depth_pass.hlsl
  56. 7
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_reconstruct_previous_depth_pass.hlsl.meta
  57. 60
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_reproject.h.meta
  58. 105
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_resources.h
  59. 60
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_resources.h.meta
  60. 60
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_sample.h.meta
  61. 60
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_tcr_autogen.h.meta
  62. 7
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_tcr_autogen_pass.hlsl.meta
  63. 60
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_upsample.h.meta
  64. 60
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_spd.h.meta
  65. 2
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3.meta
  66. 24
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_accumulate_pass.compute
  67. 2
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_accumulate_pass.compute.meta
  68. 12
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_autogen_reactive_pass.compute
  69. 2
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_autogen_reactive_pass.compute.meta
  70. 16
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_compute_luminance_pyramid_pass.compute
  71. 2
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_compute_luminance_pyramid_pass.compute.meta
  72. 12
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_depth_clip_pass.compute
  73. 2
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_depth_clip_pass.compute.meta
  74. 10
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_lock_pass.compute
  75. 8
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_lock_pass.compute.meta
  76. 10
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_rcas_pass.compute
  77. 8
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_rcas_pass.compute.meta
  78. 14
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_reconstruct_previous_depth_pass.compute
  79. 8
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_reconstruct_previous_depth_pass.compute.meta
  80. 12
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_tcr_autogen_pass.compute
  81. 8
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_tcr_autogen_pass.compute.meta
  82. 11
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_unity_common.cginc
  83. 2
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_unity_common.cginc.meta
  84. 2
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders.meta
  85. 79
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_accumulate_pass.hlsl
  86. 2
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_accumulate_pass.hlsl.meta
  87. 77
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_autogen_reactive_pass.hlsl
  88. 2
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_autogen_reactive_pass.hlsl.meta
  89. 55
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_compute_luminance_pyramid_pass.hlsl
  90. 2
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_compute_luminance_pyramid_pass.hlsl.meta
  91. 67
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_depth_clip_pass.hlsl
  92. 7
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_depth_clip_pass.hlsl.meta
  93. 56
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_lock_pass.hlsl
  94. 7
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_lock_pass.hlsl.meta
  95. 53
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_rcas_pass.hlsl
  96. 7
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_rcas_pass.hlsl.meta
  97. 64
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_reconstruct_previous_depth_pass.hlsl
  98. 7
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_reconstruct_previous_depth_pass.hlsl.meta
  99. 96
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_tcr_autogen_pass.hlsl
  100. 7
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_tcr_autogen_pass.hlsl.meta

2
Assets/Scenes/SampleScenePPV2.unity

@ -347,7 +347,7 @@ MonoBehaviour:
stationaryBlending: 0.95
motionBlending: 0.85
superResolution:
qualityMode: 1
qualityMode: 2
performSharpenPass: 1
sharpness: 0.8
enableFP16: 0

6
Assets/Scripts/DebugDumper.cs

@ -78,8 +78,8 @@ public class DebugDumper : MonoBehaviour
if (Input.GetButtonDown("Fire2"))
{
int quality = (int)_layer.superResolution.qualityMode;
quality = (quality + 1) % Enum.GetValues(typeof(Fsr2.QualityMode)).Length;
_layer.superResolution.qualityMode = (Fsr2.QualityMode)quality;
quality = (quality + 1) % Enum.GetValues(typeof(Fsr3Upscaler.QualityMode)).Length;
_layer.superResolution.qualityMode = (Fsr3Upscaler.QualityMode)quality;
}
if (Input.GetButtonDown("Fire3"))
@ -115,7 +115,7 @@ public class DebugDumper : MonoBehaviour
GUI.matrix = Matrix4x4.Scale(new Vector3(scale, scale, scale));
}
GUILayout.Label($"FSR2: {(_layer.antialiasingMode == PostProcessLayer.Antialiasing.SuperResolution ? "Enabled" : "Disabled")}");
GUILayout.Label($"FSR3 Upscaler: {(_layer.antialiasingMode == PostProcessLayer.Antialiasing.SuperResolution ? "Enabled" : "Disabled")}");
GUILayout.Label($"Quality: {_layer.superResolution.qualityMode}");
GUILayout.Label($"Auto-exposure: {(_layer.superResolution.exposureSource)}");
GUILayout.Label($"Scale: {_scaleFactor:0.00}");

2
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/PostProcessLayerEditor.cs

@ -62,7 +62,7 @@ namespace UnityEditor.Rendering.PostProcessing
new GUIContent("Fast Approximate Anti-aliasing (FXAA)"),
new GUIContent("Subpixel Morphological Anti-aliasing (SMAA)"),
new GUIContent("Temporal Anti-aliasing (TAA)"),
new GUIContent("FidelityFX Super Resolution 2 (FSR2)")
new GUIContent("FidelityFX Super Resolution 3 (FSR3) Upscaler")
};
enum ExportMode

67
Packages/com.unity.postprocessing@3.2.2/PostProcessing/PostProcessResources.asset

@ -3,8 +3,9 @@
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
@ -92,19 +93,15 @@ MonoBehaviour:
bloom: {fileID: 4800000, guid: c1e1d3119c6fd4646aea0b4b74cacc1a, type: 3}
copy: {fileID: 4800000, guid: cdbdb71de5f9c454b980f6d0e87f0afb, type: 3}
copyStd: {fileID: 4800000, guid: 4bf4cff0d0bac3d43894e2e8839feb40, type: 3}
copyStdFromTexArray: {fileID: 4800000, guid: 02d2da9bc88d25c4d878c1ed4e0b3854,
type: 3}
copyStdFromDoubleWide: {fileID: 4800000, guid: e8ce9961912f3214586fe8709b9012c1,
type: 3}
copyStdFromTexArray: {fileID: 4800000, guid: 02d2da9bc88d25c4d878c1ed4e0b3854, type: 3}
copyStdFromDoubleWide: {fileID: 4800000, guid: e8ce9961912f3214586fe8709b9012c1, type: 3}
discardAlpha: {fileID: 4800000, guid: 5ab0816423f0dfe45841cab3b05ec9ef, type: 3}
depthOfField: {fileID: 4800000, guid: 0ef78d24e85a44f4da9d5b5eaa00e50b, type: 3}
finalPass: {fileID: 4800000, guid: f75014305794b3948a3c6d5ccd550e05, type: 3}
grainBaker: {fileID: 4800000, guid: 0d8afcb51cc9f0349a6d190da929b838, type: 3}
motionBlur: {fileID: 4800000, guid: 2c459b89a7c8b1a4fbefe0d81341651c, type: 3}
temporalAntialiasing: {fileID: 4800000, guid: 51bcf79c50dc92e47ba87821b61100c3,
type: 3}
subpixelMorphologicalAntialiasing: {fileID: 4800000, guid: 81af42a93ade3dd46a9b583d4eec76d6,
type: 3}
temporalAntialiasing: {fileID: 4800000, guid: 51bcf79c50dc92e47ba87821b61100c3, type: 3}
subpixelMorphologicalAntialiasing: {fileID: 4800000, guid: 81af42a93ade3dd46a9b583d4eec76d6, type: 3}
texture2dLerp: {fileID: 4800000, guid: 34a819c9e33402547a81619693adc8d5, type: 3}
uber: {fileID: 4800000, guid: 382151503e2a43a4ebb7366d1632731d, type: 3}
lut2DBaker: {fileID: 4800000, guid: 7ad194cbe7d006f4bace915156972026, type: 3}
@ -116,8 +113,7 @@ MonoBehaviour:
deferredFog: {fileID: 4800000, guid: 4117fce9491711c4094d33a048e36e73, type: 3}
scalableAO: {fileID: 4800000, guid: d7640629310e79646af0f46eb55ae466, type: 3}
multiScaleAO: {fileID: 4800000, guid: 67f9497810829eb4791ec19e95781e51, type: 3}
screenSpaceReflections: {fileID: 4800000, guid: f997a3dc9254c44459323cced085150c,
type: 3}
screenSpaceReflections: {fileID: 4800000, guid: f997a3dc9254c44459323cced085150c, type: 3}
computeShaders:
autoExposure: {fileID: 7200000, guid: 34845e0ca016b7448842e965db5890a5, type: 3}
exposureHistogram: {fileID: 7200000, guid: 8c2fcbdf9bc58664f89917f7b9d79501, type: 3}
@ -126,30 +122,25 @@ MonoBehaviour:
gammaHistogram: {fileID: 7200000, guid: 18183ebfeeab97749b43e38b928604a7, type: 3}
waveform: {fileID: 7200000, guid: 92c63830cd50c0b4fbb8233613839958, type: 3}
vectorscope: {fileID: 7200000, guid: e1efca7c36fd01840aae0dd10378de5c, type: 3}
multiScaleAODownsample1: {fileID: 7200000, guid: 4c63bc487e6c29a4a99f85a6c47b292b,
type: 3}
multiScaleAODownsample2: {fileID: 7200000, guid: e4d3e4779e48a374f91d48d4c0aedb7b,
type: 3}
multiScaleAORender: {fileID: 7200000, guid: 34a460e8a2e66c243a9c12024e5a798d,
type: 3}
multiScaleAOUpsample: {fileID: 7200000, guid: 600d6212b59bb40409d19d750b5fd1e9,
type: 3}
gaussianDownsample: {fileID: 7200000, guid: 6dba4103d23a7904fbc49099355aff3e,
type: 3}
multiScaleAODownsample1: {fileID: 7200000, guid: 4c63bc487e6c29a4a99f85a6c47b292b, type: 3}
multiScaleAODownsample2: {fileID: 7200000, guid: e4d3e4779e48a374f91d48d4c0aedb7b, type: 3}
multiScaleAORender: {fileID: 7200000, guid: 34a460e8a2e66c243a9c12024e5a798d, type: 3}
multiScaleAOUpsample: {fileID: 7200000, guid: 600d6212b59bb40409d19d750b5fd1e9, type: 3}
gaussianDownsample: {fileID: 7200000, guid: 6dba4103d23a7904fbc49099355aff3e, type: 3}
namedShaders:
- name: FSR2/ffx_fsr2_compute_luminance_pyramid_pass
shader: {fileID: 7200000, guid: 0894ebeefb6aa7d4680c71dffbda3fee, type: 3}
- name: FSR2/ffx_fsr2_reconstruct_previous_depth_pass
shader: {fileID: 7200000, guid: 6ef1b4c25874e334dad5ba3ac6345e32, type: 3}
- name: FSR2/ffx_fsr2_depth_clip_pass
shader: {fileID: 7200000, guid: 8026d9d8542eab6499c32d5d46beb2b6, type: 3}
- name: FSR2/ffx_fsr2_lock_pass
shader: {fileID: 7200000, guid: 3c96d72b39a840c428c901628dab92c0, type: 3}
- name: FSR2/ffx_fsr2_accumulate_pass
shader: {fileID: 7200000, guid: 702560780e923c84394c9b22ba460a9c, type: 3}
- name: FSR2/ffx_fsr2_rcas_pass
shader: {fileID: 7200000, guid: 5a82801f160ff6a4eb47db567216e592, type: 3}
- name: FSR2/ffx_fsr2_autogen_reactive_pass
shader: {fileID: 7200000, guid: d18fb8811ca4753469c439784546104e, type: 3}
- name: FSR2/ffx_fsr2_tcr_autogen_pass
shader: {fileID: 7200000, guid: b478fba0a6a87b44b8be7c35deb5f0dc, type: 3}
- name: FSR3/ffx_fsr3upscaler_compute_luminance_pyramid_pass
shader: {fileID: 7200000, guid: d253be05abcdc80428503d3e4cce3a36, type: 3}
- name: FSR3/ffx_fsr3upscaler_reconstruct_previous_depth_pass
shader: {fileID: 7200000, guid: 4f59e5b9179d74844ae06a30ae1e0629, type: 3}
- name: FSR3/ffx_fsr3upscaler_depth_clip_pass
shader: {fileID: 7200000, guid: 20e44016ed34b0d4b8de499d1b566c69, type: 3}
- name: FSR3/ffx_fsr3upscaler_lock_pass
shader: {fileID: 7200000, guid: a135306e6d1857e43a86ef20db2a47fe, type: 3}
- name: FSR3/ffx_fsr3upscaler_accumulate_pass
shader: {fileID: 7200000, guid: c9b45f0ae7673694ba57a4aadfe212e9, type: 3}
- name: FSR3/ffx_fsr3upscaler_rcas_pass
shader: {fileID: 7200000, guid: 7aaf5cfff022de2499e9b0412f947f6c, type: 3}
- name: FSR3/ffx_fsr3upscaler_autogen_reactive_pass
shader: {fileID: 7200000, guid: 5716b91fdaa4e9e439df6b96a796fe6e, type: 3}
- name: FSR3/ffx_fsr3upscaler_tcr_autogen_pass
shader: {fileID: 7200000, guid: 75cdc6ef23f08ed498d4da511923fcea, type: 3}

92
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/SuperResolution.cs

@ -31,10 +31,10 @@ namespace UnityEngine.Rendering.PostProcessing
[Serializable]
public class SuperResolution
{
public Func<PostProcessRenderContext, IFsr2Callbacks> callbacksFactory { get; set; } = (context) => new Callbacks(context.resources);
public Func<PostProcessRenderContext, IFsr3UpscalerCallbacks> callbacksFactory { get; set; } = (context) => new Callbacks(context.resources);
[Tooltip("Standard scaling ratio presets.")]
public Fsr2.QualityMode qualityMode = Fsr2.QualityMode.Quality;
public Fsr3Upscaler.QualityMode qualityMode = Fsr3Upscaler.QualityMode.Quality;
[Tooltip("Apply RCAS sharpening to the image after upscaling.")]
public bool performSharpenPass = true;
@ -44,7 +44,7 @@ namespace UnityEngine.Rendering.PostProcessing
[Tooltip("Allow the use of half precision compute operations, potentially improving performance if the platform supports it.")]
public bool enableFP16 = false;
[Tooltip("Choose where to get the exposure value from. Use auto-exposure from either FSR2 or Unity, provide a manual exposure texture, or use a default value.")]
[Tooltip("Choose where to get the exposure value from. Use auto-exposure from either FSR3 or Unity, provide a manual exposure texture, or use a default value.")]
public ExposureSource exposureSource = ExposureSource.Auto;
[Tooltip("Value by which the input signal will be divided, to get back to the original signal produced by the game.")]
public float preExposure = 1.0f;
@ -78,7 +78,7 @@ namespace UnityEngine.Rendering.PostProcessing
[Tooltip("A value to set for the binary reactive mask")]
[Range(0, 1)] public float binaryValue = 0.9f;
[Tooltip("Flags to determine how to generate the reactive mask")]
public Fsr2.GenerateReactiveFlags flags = Fsr2.GenerateReactiveFlags.ApplyTonemap | Fsr2.GenerateReactiveFlags.ApplyThreshold | Fsr2.GenerateReactiveFlags.UseComponentsMax;
public Fsr3Upscaler.GenerateReactiveFlags flags = Fsr3Upscaler.GenerateReactiveFlags.ApplyTonemap | Fsr3Upscaler.GenerateReactiveFlags.ApplyThreshold | Fsr3Upscaler.GenerateReactiveFlags.UseComponentsMax;
}
[Tooltip("(Experimental) Automatically generate and use Reactive mask and Transparency & composition mask internally.")]
@ -104,17 +104,17 @@ namespace UnityEngine.Rendering.PostProcessing
public Vector2Int displaySize => _displaySize;
public RenderTargetIdentifier colorOpaqueOnly { get; set; }
private Fsr2Context _fsrContext;
private Fsr3UpscalerContext _fsrContext;
private Vector2Int _maxRenderSize;
private Vector2Int _displaySize;
private bool _resetHistory;
private IFsr2Callbacks _callbacks;
private IFsr3UpscalerCallbacks _callbacks;
private readonly Fsr2.DispatchDescription _dispatchDescription = new Fsr2.DispatchDescription();
private readonly Fsr2.GenerateReactiveDescription _genReactiveDescription = new Fsr2.GenerateReactiveDescription();
private readonly Fsr3Upscaler.DispatchDescription _dispatchDescription = new Fsr3Upscaler.DispatchDescription();
private readonly Fsr3Upscaler.GenerateReactiveDescription _genReactiveDescription = new Fsr3Upscaler.GenerateReactiveDescription();
private Fsr2.QualityMode _prevQualityMode;
private Fsr3Upscaler.QualityMode _prevQualityMode;
private ExposureSource _prevExposureSource;
private Vector2Int _prevDisplaySize;
@ -152,7 +152,7 @@ namespace UnityEngine.Rendering.PostProcessing
// Determine the desired rendering and display resolutions
_displaySize = new Vector2Int(camera.pixelWidth, camera.pixelHeight);
Fsr2.GetRenderResolutionFromQualityMode(out int maxRenderWidth, out int maxRenderHeight, _displaySize.x, _displaySize.y, qualityMode);
Fsr3Upscaler.GetRenderResolutionFromQualityMode(out int maxRenderWidth, out int maxRenderHeight, _displaySize.x, _displaySize.y, qualityMode);
_maxRenderSize = new Vector2Int(maxRenderWidth, maxRenderHeight);
// Render to a smaller portion of the screen by manipulating the camera's viewport rect
@ -168,10 +168,10 @@ namespace UnityEngine.Rendering.PostProcessing
public void Render(PostProcessRenderContext context)
{
var cmd = context.command;
cmd.BeginSample("FSR2");
cmd.BeginSample("FSR3 Upscaler");
// Monitor for any resolution changes and recreate the FSR2 context if necessary
// We can't create an FSR2 context without info from the post-processing context, so delay the initial setup until here
// Monitor for any resolution changes and recreate the FSR3 Upscaler context if necessary
// We can't create an FSR3 Upscaler context without info from the post-processing context, so delay the initial setup until here
if (_fsrContext == null || _displaySize.x != _prevDisplaySize.x || _displaySize.y != _prevDisplaySize.y || qualityMode != _prevQualityMode || exposureSource != _prevExposureSource)
{
DestroyFsrContext();
@ -185,14 +185,14 @@ namespace UnityEngine.Rendering.PostProcessing
SetupAutoReactiveDescription(context);
var scaledRenderSize = _genReactiveDescription.RenderSize;
cmd.GetTemporaryRT(Fsr2ShaderIDs.UavAutoReactive, scaledRenderSize.x, scaledRenderSize.y, 0, default, GraphicsFormat.R8_UNorm, 1, true);
cmd.GetTemporaryRT(Fsr3ShaderIDs.UavAutoReactive, scaledRenderSize.x, scaledRenderSize.y, 0, default, GraphicsFormat.R8_UNorm, 1, true);
_fsrContext.GenerateReactiveMask(_genReactiveDescription, cmd);
_dispatchDescription.Reactive = new Fsr2.ResourceView(Fsr2ShaderIDs.UavAutoReactive);
_dispatchDescription.Reactive = new Fsr3Upscaler.ResourceView(Fsr3ShaderIDs.UavAutoReactive);
}
_fsrContext.Dispatch(_dispatchDescription, cmd);
cmd.EndSample("FSR2");
cmd.EndSample("FSR3 Upscaler");
_resetHistory = false;
}
@ -203,18 +203,18 @@ namespace UnityEngine.Rendering.PostProcessing
_prevExposureSource = exposureSource;
_prevDisplaySize = _displaySize;
// Initialize FSR2 context
Fsr2.InitializationFlags flags = 0;
if (context.camera.allowHDR) flags |= Fsr2.InitializationFlags.EnableHighDynamicRange;
if (enableFP16) flags |= Fsr2.InitializationFlags.EnableFP16Usage;
if (exposureSource == ExposureSource.Auto) flags |= Fsr2.InitializationFlags.EnableAutoExposure;
if (RuntimeUtilities.IsDynamicResolutionEnabled(context.camera)) flags |= Fsr2.InitializationFlags.EnableDynamicResolution;
// Initialize FSR3 Upscaler context
Fsr3Upscaler.InitializationFlags flags = 0;
if (context.camera.allowHDR) flags |= Fsr3Upscaler.InitializationFlags.EnableHighDynamicRange;
if (enableFP16) flags |= Fsr3Upscaler.InitializationFlags.EnableFP16Usage;
if (exposureSource == ExposureSource.Auto) flags |= Fsr3Upscaler.InitializationFlags.EnableAutoExposure;
if (RuntimeUtilities.IsDynamicResolutionEnabled(context.camera)) flags |= Fsr3Upscaler.InitializationFlags.EnableDynamicResolution;
_callbacks = callbacksFactory(context);
_fsrContext = Fsr2.CreateContext(_displaySize, _maxRenderSize, _callbacks, flags);
_fsrContext = Fsr3Upscaler.CreateContext(_displaySize, _maxRenderSize, _callbacks, flags);
// Apply a mipmap bias so that textures retain their sharpness
float biasOffset = Fsr2.GetMipmapBiasOffset(_maxRenderSize.x, _displaySize.x);
float biasOffset = Fsr3Upscaler.GetMipmapBiasOffset(_maxRenderSize.x, _displaySize.x);
if (!float.IsNaN(biasOffset) && !float.IsInfinity(biasOffset))
{
_callbacks.ApplyMipmapBias(biasOffset);
@ -241,9 +241,9 @@ namespace UnityEngine.Rendering.PostProcessing
{
var scaledRenderSize = GetScaledRenderSize(camera);
// Perform custom jittering of the camera's projection matrix according to FSR2's recipe
int jitterPhaseCount = Fsr2.GetJitterPhaseCount(scaledRenderSize.x, _displaySize.x);
Fsr2.GetJitterOffset(out float jitterX, out float jitterY, Time.frameCount, jitterPhaseCount);
// Perform custom jittering of the camera's projection matrix according to FSR3's recipe
int jitterPhaseCount = Fsr3Upscaler.GetJitterPhaseCount(scaledRenderSize.x, _displaySize.x);
Fsr3Upscaler.GetJitterOffset(out float jitterX, out float jitterY, Time.frameCount, jitterPhaseCount);
_dispatchDescription.JitterOffset = new Vector2(jitterX, jitterY);
@ -262,22 +262,22 @@ namespace UnityEngine.Rendering.PostProcessing
{
var camera = context.camera;
// Set up the main FSR2 dispatch parameters
_dispatchDescription.Color = new Fsr2.ResourceView(context.source);
_dispatchDescription.Depth = new Fsr2.ResourceView(BuiltinRenderTextureType.CameraTarget, RenderTextureSubElement.Depth);
_dispatchDescription.MotionVectors = new Fsr2.ResourceView(BuiltinRenderTextureType.MotionVectors);
_dispatchDescription.Exposure = Fsr2.ResourceView.Unassigned;
_dispatchDescription.Reactive = Fsr2.ResourceView.Unassigned;
_dispatchDescription.TransparencyAndComposition = Fsr2.ResourceView.Unassigned;
if (exposureSource == ExposureSource.Manual && exposure != null) _dispatchDescription.Exposure = new Fsr2.ResourceView(exposure);
if (exposureSource == ExposureSource.Unity) _dispatchDescription.Exposure = new Fsr2.ResourceView(context.autoExposureTexture);
if (reactiveMask != null) _dispatchDescription.Reactive = new Fsr2.ResourceView(reactiveMask);
if (transparencyAndCompositionMask != null) _dispatchDescription.TransparencyAndComposition = new Fsr2.ResourceView(transparencyAndCompositionMask);
// Set up the main FSR3 Upscaler dispatch parameters
_dispatchDescription.Color = new Fsr3Upscaler.ResourceView(context.source);
_dispatchDescription.Depth = new Fsr3Upscaler.ResourceView(BuiltinRenderTextureType.CameraTarget, RenderTextureSubElement.Depth);
_dispatchDescription.MotionVectors = new Fsr3Upscaler.ResourceView(BuiltinRenderTextureType.MotionVectors);
_dispatchDescription.Exposure = Fsr3Upscaler.ResourceView.Unassigned;
_dispatchDescription.Reactive = Fsr3Upscaler.ResourceView.Unassigned;
_dispatchDescription.TransparencyAndComposition = Fsr3Upscaler.ResourceView.Unassigned;
if (exposureSource == ExposureSource.Manual && exposure != null) _dispatchDescription.Exposure = new Fsr3Upscaler.ResourceView(exposure);
if (exposureSource == ExposureSource.Unity) _dispatchDescription.Exposure = new Fsr3Upscaler.ResourceView(context.autoExposureTexture);
if (reactiveMask != null) _dispatchDescription.Reactive = new Fsr3Upscaler.ResourceView(reactiveMask);
if (transparencyAndCompositionMask != null) _dispatchDescription.TransparencyAndComposition = new Fsr3Upscaler.ResourceView(transparencyAndCompositionMask);
var scaledRenderSize = GetScaledRenderSize(context.camera);
_dispatchDescription.Output = new Fsr2.ResourceView(context.destination);
_dispatchDescription.Output = new Fsr3Upscaler.ResourceView(context.destination);
_dispatchDescription.PreExposure = preExposure;
_dispatchDescription.EnableSharpening = performSharpenPass;
_dispatchDescription.Sharpness = sharpness;
@ -296,7 +296,7 @@ namespace UnityEngine.Rendering.PostProcessing
_dispatchDescription.EnableAutoReactive = autoGenerateTransparencyAndComposition;
if (autoGenerateTransparencyAndComposition)
{
_dispatchDescription.ColorOpaqueOnly = new Fsr2.ResourceView(colorOpaqueOnly);
_dispatchDescription.ColorOpaqueOnly = new Fsr3Upscaler.ResourceView(colorOpaqueOnly);
_dispatchDescription.AutoTcThreshold = generateTransparencyAndCompositionParameters.autoTcThreshold;
_dispatchDescription.AutoTcScale = generateTransparencyAndCompositionParameters.autoTcScale;
_dispatchDescription.AutoReactiveScale = generateTransparencyAndCompositionParameters.autoReactiveScale;
@ -305,7 +305,7 @@ namespace UnityEngine.Rendering.PostProcessing
if (SystemInfo.usesReversedZBuffer)
{
// Swap the near and far clip plane distances as FSR2 expects this when using inverted depth
// Swap the near and far clip plane distances as FSR3 expects this when using inverted depth
(_dispatchDescription.CameraNear, _dispatchDescription.CameraFar) = (_dispatchDescription.CameraFar, _dispatchDescription.CameraNear);
}
}
@ -313,9 +313,9 @@ namespace UnityEngine.Rendering.PostProcessing
private void SetupAutoReactiveDescription(PostProcessRenderContext context)
{
// Set up the parameters to auto-generate a reactive mask
_genReactiveDescription.ColorOpaqueOnly = new Fsr2.ResourceView(colorOpaqueOnly);
_genReactiveDescription.ColorPreUpscale = new Fsr2.ResourceView(context.source);
_genReactiveDescription.OutReactive = new Fsr2.ResourceView(Fsr2ShaderIDs.UavAutoReactive);
_genReactiveDescription.ColorOpaqueOnly = new Fsr3Upscaler.ResourceView(colorOpaqueOnly);
_genReactiveDescription.ColorPreUpscale = new Fsr3Upscaler.ResourceView(context.source);
_genReactiveDescription.OutReactive = new Fsr3Upscaler.ResourceView(Fsr3ShaderIDs.UavAutoReactive);
_genReactiveDescription.RenderSize = GetScaledRenderSize(context.camera);
_genReactiveDescription.Scale = generateReactiveParameters.scale;
_genReactiveDescription.CutoffThreshold = generateReactiveParameters.cutoffThreshold;
@ -331,7 +331,7 @@ namespace UnityEngine.Rendering.PostProcessing
return new Vector2Int(Mathf.CeilToInt(_maxRenderSize.x * ScalableBufferManager.widthScaleFactor), Mathf.CeilToInt(_maxRenderSize.y * ScalableBufferManager.heightScaleFactor));
}
private class Callbacks : Fsr2CallbacksBase
private class Callbacks : Fsr3UpscalerCallbacksBase
{
private readonly PostProcessResources _resources;

3
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR2/Fsr2.cs.meta

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 742d52dc87714f0d93f3b59719859dff
timeCreated: 1673441954

3
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR2/Fsr2Context.cs.meta

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 2f00ea267c3443d88bbd0e9dd7c08b4a
timeCreated: 1673442225

3
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR2/Fsr2Pass.cs.meta

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 14234aed75ce454183019d2e20a44d24
timeCreated: 1676885169

3
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR2/Fsr2Resources.cs.meta

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 22ad49193f244ab4a36d0a1512f3015f
timeCreated: 1677236102

3
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR2/Fsr2ShaderIDs.cs.meta

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: ad1eca9398174f6c85d8bc01d10993df
timeCreated: 1679060863

2
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR2.meta → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 9e2d87f36f288024cb500a20acaae11e
guid: bfeca308812376e4a8e5e49e0d96c5c6
folderAsset: yes
DefaultImporter:
externalObjects: {}

8
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR2/Fsr2ShaderIDs.cs → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3ShaderIDs.cs

@ -22,7 +22,7 @@ using UnityEngine;
namespace FidelityFX
{
internal static class Fsr2ShaderIDs
internal static class Fsr3ShaderIDs
{
// Shader resource views, i.e. read-only bindings
internal static readonly int SrvInputColor = Shader.PropertyToID("r_input_color_jittered");
@ -36,7 +36,7 @@ namespace FidelityFX
internal static readonly int SrvReconstructedPrevNearestDepth = Shader.PropertyToID("r_reconstructed_previous_nearest_depth");
internal static readonly int SrvDilatedMotionVectors = Shader.PropertyToID("r_dilated_motion_vectors");
internal static readonly int SrvPrevDilatedMotionVectors = Shader.PropertyToID("r_previous_dilated_motion_vectors");
internal static readonly int SrvDilatedDepth = Shader.PropertyToID("r_dilatedDepth");
internal static readonly int SrvDilatedDepth = Shader.PropertyToID("r_dilated_depth");
internal static readonly int SrvInternalUpscaled = Shader.PropertyToID("r_internal_upscaled_color");
internal static readonly int SrvLockStatus = Shader.PropertyToID("r_lock_status");
internal static readonly int SrvLockInputLuma = Shader.PropertyToID("r_lock_input_luma");
@ -53,7 +53,7 @@ namespace FidelityFX
// Unordered access views, i.e. random read/write bindings
internal static readonly int UavReconstructedPrevNearestDepth = Shader.PropertyToID("rw_reconstructed_previous_nearest_depth");
internal static readonly int UavDilatedMotionVectors = Shader.PropertyToID("rw_dilated_motion_vectors");
internal static readonly int UavDilatedDepth = Shader.PropertyToID("rw_dilatedDepth");
internal static readonly int UavDilatedDepth = Shader.PropertyToID("rw_dilated_depth");
internal static readonly int UavInternalUpscaled = Shader.PropertyToID("rw_internal_upscaled_color");
internal static readonly int UavLockStatus = Shader.PropertyToID("rw_lock_status");
internal static readonly int UavLockInputLuma = Shader.PropertyToID("rw_lock_input_luma");
@ -72,7 +72,7 @@ namespace FidelityFX
internal static readonly int UavPrevColorPostAlpha = Shader.PropertyToID("rw_output_prev_color_post_alpha");
// Constant buffer bindings
internal static readonly int CbFsr2 = Shader.PropertyToID("cbFSR2");
internal static readonly int CbFsr3Upscaler = Shader.PropertyToID("cbFSR3Upscaler");
internal static readonly int CbSpd = Shader.PropertyToID("cbSPD");
internal static readonly int CbRcas = Shader.PropertyToID("cbRCAS");
internal static readonly int CbGenReactive = Shader.PropertyToID("cbGenerateReactive");

3
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3ShaderIDs.cs.meta

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a0e0bcc2967836742b7864d1cafafbf0
timeCreated: 1679060863

31
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR2/Fsr2.cs → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3Upscaler.cs

@ -26,14 +26,14 @@ using UnityEngine.Rendering;
namespace FidelityFX
{
/// <summary>
/// A collection of helper functions and data structures required by the FSR2 process.
/// A collection of helper functions and data structures required by the FSR3 Upscaler process.
/// </summary>
public static class Fsr2
public static class Fsr3Upscaler
{
/// <summary>
/// Creates a new FSR2 context with standard parameters that are appropriate for the current platform.
/// Creates a new FSR3 Upscaler context with standard parameters that are appropriate for the current platform.
/// </summary>
public static Fsr2Context CreateContext(Vector2Int displaySize, Vector2Int maxRenderSize, IFsr2Callbacks callbacks, InitializationFlags flags = 0)
public static Fsr3UpscalerContext CreateContext(Vector2Int displaySize, Vector2Int maxRenderSize, IFsr3UpscalerCallbacks callbacks, InitializationFlags flags = 0)
{
if (SystemInfo.usesReversedZBuffer)
flags |= InitializationFlags.EnableDepthInverted;
@ -44,7 +44,7 @@ namespace FidelityFX
flags |= InitializationFlags.EnableDebugChecking;
#endif
Debug.Log($"Setting up FSR2 with render size: {maxRenderSize.x}x{maxRenderSize.y}, display size: {displaySize.x}x{displaySize.y}, flags: {flags}");
Debug.Log($"Setting up FSR3 Upscaler with render size: {maxRenderSize.x}x{maxRenderSize.y}, display size: {displaySize.x}x{displaySize.y}, flags: {flags}");
var contextDescription = new ContextDescription
{
@ -54,7 +54,7 @@ namespace FidelityFX
Callbacks = callbacks,
};
var context = new Fsr2Context();
var context = new Fsr3UpscalerContext();
context.Create(contextDescription);
return context;
}
@ -63,6 +63,8 @@ namespace FidelityFX
{
switch (qualityMode)
{
case QualityMode.NativeAA:
return 1.0f;
case QualityMode.UltraQuality:
return 1.2f;
case QualityMode.Quality:
@ -134,11 +136,12 @@ namespace FidelityFX
public enum QualityMode
{
UltraQuality = 0,
Quality = 1,
Balanced = 2,
Performance = 3,
UltraPerformance = 4,
NativeAA = 0,
UltraQuality = 1,
Quality = 2,
Balanced = 3,
Performance = 4,
UltraPerformance = 5,
}
[Flags]
@ -160,7 +163,7 @@ namespace FidelityFX
public InitializationFlags Flags;
public Vector2Int MaxRenderSize;
public Vector2Int DisplaySize;
public IFsr2Callbacks Callbacks;
public IFsr3UpscalerCallbacks Callbacks;
}
/// <summary>
@ -231,7 +234,7 @@ namespace FidelityFX
/// <summary>
/// A structure encapsulating the parameters for automatic generation of a reactive mask.
/// The default values for Scale, CutoffThreshold, BinaryValue and Flags were taken from the FSR2 demo project.
/// The default values for Scale, CutoffThreshold, BinaryValue and Flags were taken from the FSR3 demo project.
/// </summary>
public class GenerateReactiveDescription
{
@ -255,7 +258,7 @@ namespace FidelityFX
}
[Serializable, StructLayout(LayoutKind.Sequential)]
internal struct Fsr2Constants
internal struct UpscalerConstants
{
public Vector2Int renderSize;
public Vector2Int maxRenderSize;

3
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3Upscaler.cs.meta

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: df8b18c192f2dc145b4b43e68fd3407d
timeCreated: 1673441954

22
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR2/Fsr2Callbacks.cs → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerCallbacks.cs

@ -23,13 +23,11 @@ using UnityEngine;
namespace FidelityFX
{
/// <summary>
/// A collection of callbacks required by the FSR2 process.
/// This allows some customization by the game dev on how to integrate FSR2 into their own game setup.
/// A collection of callbacks required by the FSR3 Upscaler process.
/// This allows some customization by the game dev on how to integrate FSR3 upscaling into their own game setup.
/// </summary>
public interface IFsr2Callbacks
public interface IFsr3UpscalerCallbacks
{
Shader LoadShader(string name);
void UnloadShader(Shader shader);
ComputeShader LoadComputeShader(string name);
void UnloadComputeShader(ComputeShader shader);
@ -47,22 +45,12 @@ namespace FidelityFX
}
/// <summary>
/// Default implementation of IFsr2Callbacks using simple Resources calls.
/// Default implementation of IFsr3UpscalerCallbacks using simple Resources calls.
/// These are fine for testing but a proper game will want to extend and override these methods.
/// </summary>
public class Fsr2CallbacksBase: IFsr2Callbacks
public class Fsr3UpscalerCallbacksBase: IFsr3UpscalerCallbacks
{
protected float CurrentBiasOffset = 0;
public virtual Shader LoadShader(string name)
{
return Resources.Load<Shader>(name);
}
public virtual void UnloadShader(Shader shader)
{
Resources.UnloadAsset(shader);
}
public virtual ComputeShader LoadComputeShader(string name)
{

2
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR2/Fsr2Callbacks.cs.meta → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerCallbacks.cs.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 5906deeb6ec2854449bf33db2e71a046
guid: e1b555daa29ec3043a8cf89b4db31a26
MonoImporter:
externalObjects: {}
serializedVersion: 2

208
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR2/Fsr2Context.cs → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerContext.cs

@ -19,7 +19,6 @@
// THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using UnityEngine;
using UnityEngine.Rendering;
@ -27,69 +26,69 @@ using UnityEngine.Rendering;
namespace FidelityFX
{
/// <summary>
/// This class loosely matches the FfxFsr2Context struct from the original FSR2 codebase.
/// It manages the various resources and compute passes required by the FSR2 process.
/// This class loosely matches the FfxFsr3UpscalerContext struct from the original FSR3 codebase.
/// It manages the various resources and compute passes required by the FSR3 Upscaler process.
/// Note that this class does not know anything about Unity render pipelines; all it knows is CommandBuffers and RenderTargetIdentifiers.
/// This should make it suitable for integration with any of the available Unity render pipelines.
/// </summary>
public class Fsr2Context
public class Fsr3UpscalerContext
{
private const int MaxQueuedFrames = 16;
private Fsr2.ContextDescription _contextDescription;
private Fsr3Upscaler.ContextDescription _contextDescription;
private CommandBuffer _commandBuffer;
private Fsr2Pass _depthClipPass;
private Fsr2Pass _reconstructPreviousDepthPass;
private Fsr2Pass _lockPass;
private Fsr2Pass _accumulatePass;
private Fsr2Pass _rcasPass;
private Fsr2Pass _computeLuminancePyramidPass;
private Fsr2Pass _generateReactivePass;
private Fsr2Pass _tcrAutogeneratePass;
private Fsr3UpscalerPass _depthClipPass;
private Fsr3UpscalerPass _reconstructPreviousDepthPass;
private Fsr3UpscalerPass _lockPass;
private Fsr3UpscalerPass _accumulatePass;
private Fsr3UpscalerPass _rcasPass;
private Fsr3UpscalerPass _computeLuminancePyramidPass;
private Fsr3UpscalerPass _generateReactivePass;
private Fsr3UpscalerPass _tcrAutogeneratePass;
private readonly Fsr2Resources _resources = new Fsr2Resources();
private readonly Fsr3UpscalerResources _resources = new Fsr3UpscalerResources();
private ComputeBuffer _fsr2ConstantsBuffer;
private readonly Fsr2.Fsr2Constants[] _fsr2ConstantsArray = { new Fsr2.Fsr2Constants() };
private ref Fsr2.Fsr2Constants Constants => ref _fsr2ConstantsArray[0];
private ComputeBuffer _upscalerConstantsBuffer;
private readonly Fsr3Upscaler.UpscalerConstants[] _upscalerConstantsArray = { new Fsr3Upscaler.UpscalerConstants() };
private ref Fsr3Upscaler.UpscalerConstants UpscalerConsts => ref _upscalerConstantsArray[0];
private ComputeBuffer _spdConstantsBuffer;
private readonly Fsr2.SpdConstants[] _spdConstantsArray = { new Fsr2.SpdConstants() };
private ref Fsr2.SpdConstants SpdConsts => ref _spdConstantsArray[0];
private readonly Fsr3Upscaler.SpdConstants[] _spdConstantsArray = { new Fsr3Upscaler.SpdConstants() };
private ref Fsr3Upscaler.SpdConstants SpdConsts => ref _spdConstantsArray[0];
private ComputeBuffer _rcasConstantsBuffer;
private readonly Fsr2.RcasConstants[] _rcasConstantsArray = new Fsr2.RcasConstants[1];
private ref Fsr2.RcasConstants RcasConsts => ref _rcasConstantsArray[0];
private readonly Fsr3Upscaler.RcasConstants[] _rcasConstantsArray = new Fsr3Upscaler.RcasConstants[1];
private ref Fsr3Upscaler.RcasConstants RcasConsts => ref _rcasConstantsArray[0];
private ComputeBuffer _generateReactiveConstantsBuffer;
private readonly Fsr2.GenerateReactiveConstants[] _generateReactiveConstantsArray = { new Fsr2.GenerateReactiveConstants() };
private ref Fsr2.GenerateReactiveConstants GenReactiveConsts => ref _generateReactiveConstantsArray[0];
private readonly Fsr3Upscaler.GenerateReactiveConstants[] _generateReactiveConstantsArray = { new Fsr3Upscaler.GenerateReactiveConstants() };
private ref Fsr3Upscaler.GenerateReactiveConstants GenReactiveConsts => ref _generateReactiveConstantsArray[0];
private ComputeBuffer _tcrAutogenerateConstantsBuffer;
private readonly Fsr2.GenerateReactiveConstants2[] _tcrAutogenerateConstantsArray = { new Fsr2.GenerateReactiveConstants2() };
private ref Fsr2.GenerateReactiveConstants2 TcrAutoGenConsts => ref _tcrAutogenerateConstantsArray[0];
private readonly Fsr3Upscaler.GenerateReactiveConstants2[] _tcrAutogenerateConstantsArray = { new Fsr3Upscaler.GenerateReactiveConstants2() };
private ref Fsr3Upscaler.GenerateReactiveConstants2 TcrAutoGenConsts => ref _tcrAutogenerateConstantsArray[0];
private bool _firstExecution;
private Vector2 _previousJitterOffset;
private int _resourceFrameIndex;
public void Create(Fsr2.ContextDescription contextDescription)
public void Create(Fsr3Upscaler.ContextDescription contextDescription)
{
_contextDescription = contextDescription;
_commandBuffer = new CommandBuffer { name = "FSR2" };
_commandBuffer = new CommandBuffer { name = "FSR3 Upscaler" };
_fsr2ConstantsBuffer = CreateConstantBuffer<Fsr2.Fsr2Constants>();
_spdConstantsBuffer = CreateConstantBuffer<Fsr2.SpdConstants>();
_rcasConstantsBuffer = CreateConstantBuffer<Fsr2.RcasConstants>();
_generateReactiveConstantsBuffer = CreateConstantBuffer<Fsr2.GenerateReactiveConstants>();
_tcrAutogenerateConstantsBuffer = CreateConstantBuffer<Fsr2.GenerateReactiveConstants2>();
_upscalerConstantsBuffer = CreateConstantBuffer<Fsr3Upscaler.UpscalerConstants>();
_spdConstantsBuffer = CreateConstantBuffer<Fsr3Upscaler.SpdConstants>();
_rcasConstantsBuffer = CreateConstantBuffer<Fsr3Upscaler.RcasConstants>();
_generateReactiveConstantsBuffer = CreateConstantBuffer<Fsr3Upscaler.GenerateReactiveConstants>();
_tcrAutogenerateConstantsBuffer = CreateConstantBuffer<Fsr3Upscaler.GenerateReactiveConstants2>();
// Set defaults
_firstExecution = true;
_resourceFrameIndex = 0;
Constants.displaySize = _contextDescription.DisplaySize;
UpscalerConsts.displaySize = _contextDescription.DisplaySize;
_resources.Create(_contextDescription);
CreatePasses();
@ -97,14 +96,14 @@ namespace FidelityFX
private void CreatePasses()
{
_computeLuminancePyramidPass = new Fsr2ComputeLuminancePyramidPass(_contextDescription, _resources, _fsr2ConstantsBuffer, _spdConstantsBuffer);
_reconstructPreviousDepthPass = new Fsr2ReconstructPreviousDepthPass(_contextDescription, _resources, _fsr2ConstantsBuffer);
_depthClipPass = new Fsr2DepthClipPass(_contextDescription, _resources, _fsr2ConstantsBuffer);
_lockPass = new Fsr2LockPass(_contextDescription, _resources, _fsr2ConstantsBuffer);
_accumulatePass = new Fsr2AccumulatePass(_contextDescription, _resources, _fsr2ConstantsBuffer);
_rcasPass = new Fsr2RcasPass(_contextDescription, _resources, _fsr2ConstantsBuffer, _rcasConstantsBuffer);
_generateReactivePass = new Fsr2GenerateReactivePass(_contextDescription, _resources, _generateReactiveConstantsBuffer);
_tcrAutogeneratePass = new Fsr2TcrAutogeneratePass(_contextDescription, _resources, _fsr2ConstantsBuffer, _tcrAutogenerateConstantsBuffer);
_computeLuminancePyramidPass = new Fsr3UpscalerComputeLuminancePyramidPass(_contextDescription, _resources, _upscalerConstantsBuffer, _spdConstantsBuffer);
_reconstructPreviousDepthPass = new Fsr3UpscalerReconstructPreviousDepthPass(_contextDescription, _resources, _upscalerConstantsBuffer);
_depthClipPass = new Fsr3UpscalerDepthClipPass(_contextDescription, _resources, _upscalerConstantsBuffer);
_lockPass = new Fsr3UpscalerLockPass(_contextDescription, _resources, _upscalerConstantsBuffer);
_accumulatePass = new Fsr3UpscalerAccumulatePass(_contextDescription, _resources, _upscalerConstantsBuffer);
_rcasPass = new Fsr3UpscalerRcasPass(_contextDescription, _resources, _upscalerConstantsBuffer, _rcasConstantsBuffer);
_generateReactivePass = new Fsr3UpscalerGenerateReactivePass(_contextDescription, _resources, _generateReactiveConstantsBuffer);
_tcrAutogeneratePass = new Fsr3UpscalerTcrAutogeneratePass(_contextDescription, _resources, _upscalerConstantsBuffer, _tcrAutogenerateConstantsBuffer);
}
public void Destroy()
@ -124,22 +123,22 @@ namespace FidelityFX
DestroyConstantBuffer(ref _generateReactiveConstantsBuffer);
DestroyConstantBuffer(ref _rcasConstantsBuffer);
DestroyConstantBuffer(ref _spdConstantsBuffer);
DestroyConstantBuffer(ref _fsr2ConstantsBuffer);
DestroyConstantBuffer(ref _upscalerConstantsBuffer);
_commandBuffer.Dispose();
_commandBuffer = null;
}
public void Dispatch(Fsr2.DispatchDescription dispatchParams)
public void Dispatch(Fsr3Upscaler.DispatchDescription dispatchParams)
{
_commandBuffer.Clear();
Dispatch(dispatchParams, _commandBuffer);
Graphics.ExecuteCommandBuffer(_commandBuffer);
}
public void Dispatch(Fsr2.DispatchDescription dispatchParams, CommandBuffer commandBuffer)
public void Dispatch(Fsr3Upscaler.DispatchDescription dispatchParams, CommandBuffer commandBuffer)
{
if ((_contextDescription.Flags & Fsr2.InitializationFlags.EnableDebugChecking) != 0)
if ((_contextDescription.Flags & Fsr3Upscaler.InitializationFlags.EnableDebugChecking) != 0)
{
DebugCheckDispatch(dispatchParams);
}
@ -157,10 +156,10 @@ namespace FidelityFX
_firstExecution = false;
// 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 Fsr2.ResourceView(_resources.AutoExposure);
if ((_contextDescription.Flags & Fsr3Upscaler.InitializationFlags.EnableAutoExposure) != 0)
dispatchParams.Exposure = new Fsr3Upscaler.ResourceView(_resources.AutoExposure);
else if (!dispatchParams.Exposure.IsValid)
dispatchParams.Exposure = new Fsr2.ResourceView(_resources.DefaultExposure);
dispatchParams.Exposure = new Fsr3Upscaler.ResourceView(_resources.DefaultExposure);
if (dispatchParams.EnableAutoReactive)
{
@ -170,7 +169,7 @@ namespace FidelityFX
if (resetAccumulation)
{
RenderTargetIdentifier opaqueOnly = dispatchParams.ColorOpaqueOnly.IsValid ? dispatchParams.ColorOpaqueOnly.RenderTarget : Fsr2ShaderIDs.SrvOpaqueOnly;
RenderTargetIdentifier opaqueOnly = dispatchParams.ColorOpaqueOnly.IsValid ? dispatchParams.ColorOpaqueOnly.RenderTarget : Fsr3ShaderIDs.SrvOpaqueOnly;
commandBuffer.Blit(_resources.PrevPreAlpha[frameIndex ^ 1], opaqueOnly);
}
}
@ -180,16 +179,16 @@ namespace FidelityFX
_resources.DestroyTcrAutogenResources();
}
if (!dispatchParams.Reactive.IsValid) dispatchParams.Reactive = new Fsr2.ResourceView(_resources.DefaultReactive);
if (!dispatchParams.TransparencyAndComposition.IsValid) dispatchParams.TransparencyAndComposition = new Fsr2.ResourceView(_resources.DefaultReactive);
Fsr2Resources.CreateAliasableResources(commandBuffer, _contextDescription, dispatchParams);
if (!dispatchParams.Reactive.IsValid) dispatchParams.Reactive = new Fsr3Upscaler.ResourceView(_resources.DefaultReactive);
if (!dispatchParams.TransparencyAndComposition.IsValid) dispatchParams.TransparencyAndComposition = new Fsr3Upscaler.ResourceView(_resources.DefaultReactive);
Fsr3UpscalerResources.CreateAliasableResources(commandBuffer, _contextDescription, dispatchParams);
SetupConstants(dispatchParams, resetAccumulation);
// Reactive mask bias
const int threadGroupWorkRegionDim = 8;
int dispatchSrcX = (Constants.renderSize.x + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim;
int dispatchSrcY = (Constants.renderSize.y + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim;
int dispatchSrcX = (UpscalerConsts.renderSize.x + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim;
int dispatchSrcY = (UpscalerConsts.renderSize.y + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim;
int dispatchDstX = (_contextDescription.DisplaySize.x + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim;
int dispatchDstY = (_contextDescription.DisplaySize.y + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim;
@ -214,19 +213,24 @@ namespace FidelityFX
commandBuffer.ClearRenderTarget(false, true, Color.clear);
}
// FSR3: need to clear here since we need the content of this surface for frame interpolation, so clearing in the lock pass is not an option
bool depthInverted = (_contextDescription.Flags & Fsr3Upscaler.InitializationFlags.EnableDepthInverted) == Fsr3Upscaler.InitializationFlags.EnableDepthInverted;
commandBuffer.SetRenderTarget(Fsr3ShaderIDs.UavReconstructedPrevNearestDepth);
commandBuffer.ClearRenderTarget(false, true, depthInverted ? Color.clear : Color.white);
// Auto exposure
SetupSpdConstants(dispatchParams, out var dispatchThreadGroupCount);
// Initialize constant buffers data
commandBuffer.SetBufferData(_fsr2ConstantsBuffer, _fsr2ConstantsArray);
commandBuffer.SetBufferData(_upscalerConstantsBuffer, _upscalerConstantsArray);
commandBuffer.SetBufferData(_spdConstantsBuffer, _spdConstantsArray);
// Auto reactive
if (dispatchParams.EnableAutoReactive)
{
GenerateTransparencyCompositionReactive(dispatchParams, commandBuffer, frameIndex);
dispatchParams.Reactive = new Fsr2.ResourceView(_resources.AutoReactive);
dispatchParams.TransparencyAndComposition = new Fsr2.ResourceView(_resources.AutoComposition);
dispatchParams.Reactive = new Fsr3Upscaler.ResourceView(_resources.AutoReactive);
dispatchParams.TransparencyAndComposition = new Fsr3Upscaler.ResourceView(_resources.AutoComposition);
}
// Compute luminance pyramid
@ -259,17 +263,17 @@ namespace FidelityFX
_resourceFrameIndex = (_resourceFrameIndex + 1) % MaxQueuedFrames;
Fsr2Resources.DestroyAliasableResources(commandBuffer);
Fsr3UpscalerResources.DestroyAliasableResources(commandBuffer);
}
public void GenerateReactiveMask(Fsr2.GenerateReactiveDescription dispatchParams)
public void GenerateReactiveMask(Fsr3Upscaler.GenerateReactiveDescription dispatchParams)
{
_commandBuffer.Clear();
GenerateReactiveMask(dispatchParams, _commandBuffer);
Graphics.ExecuteCommandBuffer(_commandBuffer);
}
public void GenerateReactiveMask(Fsr2.GenerateReactiveDescription dispatchParams, CommandBuffer commandBuffer)
public void GenerateReactiveMask(Fsr3Upscaler.GenerateReactiveDescription dispatchParams, CommandBuffer commandBuffer)
{
const int threadGroupWorkRegionDim = 8;
int dispatchSrcX = (dispatchParams.RenderSize.x + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim;
@ -281,10 +285,10 @@ namespace FidelityFX
GenReactiveConsts.flags = (uint)dispatchParams.Flags;
commandBuffer.SetBufferData(_generateReactiveConstantsBuffer, _generateReactiveConstantsArray);
((Fsr2GenerateReactivePass)_generateReactivePass).ScheduleDispatch(commandBuffer, dispatchParams, dispatchSrcX, dispatchSrcY);
((Fsr3UpscalerGenerateReactivePass)_generateReactivePass).ScheduleDispatch(commandBuffer, dispatchParams, dispatchSrcX, dispatchSrcY);
}
private void GenerateTransparencyCompositionReactive(Fsr2.DispatchDescription dispatchParams, CommandBuffer commandBuffer, int frameIndex)
private void GenerateTransparencyCompositionReactive(Fsr3Upscaler.DispatchDescription dispatchParams, CommandBuffer commandBuffer, int frameIndex)
{
const int threadGroupWorkRegionDim = 8;
int dispatchSrcX = (dispatchParams.RenderSize.x + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim;
@ -299,9 +303,9 @@ namespace FidelityFX
_tcrAutogeneratePass.ScheduleDispatch(commandBuffer, dispatchParams, frameIndex, dispatchSrcX, dispatchSrcY);
}
private void SetupConstants(Fsr2.DispatchDescription dispatchParams, bool resetAccumulation)
private void SetupConstants(Fsr3Upscaler.DispatchDescription dispatchParams, bool resetAccumulation)
{
ref Fsr2.Fsr2Constants constants = ref Constants;
ref Fsr3Upscaler.UpscalerConstants constants = ref UpscalerConsts;
constants.jitterOffset = dispatchParams.JitterOffset;
constants.renderSize = dispatchParams.RenderSize;
@ -323,17 +327,17 @@ namespace FidelityFX
constants.preExposure = (dispatchParams.PreExposure != 0) ? dispatchParams.PreExposure : 1.0f;
// Motion vector data
Vector2Int motionVectorsTargetSize = (_contextDescription.Flags & Fsr2.InitializationFlags.EnableDisplayResolutionMotionVectors) != 0 ? constants.displaySize : constants.renderSize;
Vector2Int motionVectorsTargetSize = (_contextDescription.Flags & Fsr3Upscaler.InitializationFlags.EnableDisplayResolutionMotionVectors) != 0 ? constants.displaySize : constants.renderSize;
constants.motionVectorScale = dispatchParams.MotionVectorScale / motionVectorsTargetSize;
// Compute jitter cancellation
if ((_contextDescription.Flags & Fsr2.InitializationFlags.EnableMotionVectorsJitterCancellation) != 0)
if ((_contextDescription.Flags & Fsr3Upscaler.InitializationFlags.EnableMotionVectorsJitterCancellation) != 0)
{
constants.motionVectorJitterCancellation = (_previousJitterOffset - constants.jitterOffset) / motionVectorsTargetSize;
_previousJitterOffset = constants.jitterOffset;
}
int jitterPhaseCount = Fsr2.GetJitterPhaseCount(dispatchParams.RenderSize.x, _contextDescription.DisplaySize.x);
int jitterPhaseCount = Fsr3Upscaler.GetJitterPhaseCount(dispatchParams.RenderSize.x, _contextDescription.DisplaySize.x);
if (resetAccumulation || constants.jitterPhaseCount == 0)
{
constants.jitterPhaseCount = jitterPhaseCount;
@ -356,17 +360,17 @@ namespace FidelityFX
constants.frameIndex++;
// Shading change usage of the SPD mip levels
constants.lumaMipLevelToUse = Fsr2Pass.ShadingChangeMipLevel;
constants.lumaMipLevelToUse = Fsr3UpscalerPass.ShadingChangeMipLevel;
float mipDiv = 2 << constants.lumaMipLevelToUse;
constants.lumaMipDimensions.x = (int)(constants.maxRenderSize.x / mipDiv);
constants.lumaMipDimensions.y = (int)(constants.maxRenderSize.y / mipDiv);
}
private Vector4 SetupDeviceDepthToViewSpaceDepthParams(Fsr2.DispatchDescription dispatchParams)
private Vector4 SetupDeviceDepthToViewSpaceDepthParams(Fsr3Upscaler.DispatchDescription dispatchParams)
{
bool inverted = (_contextDescription.Flags & Fsr2.InitializationFlags.EnableDepthInverted) != 0;
bool infinite = (_contextDescription.Flags & Fsr2.InitializationFlags.EnableDepthInfinite) != 0;
bool inverted = (_contextDescription.Flags & Fsr3Upscaler.InitializationFlags.EnableDepthInverted) != 0;
bool infinite = (_contextDescription.Flags & Fsr3Upscaler.InitializationFlags.EnableDepthInfinite) != 0;
// make sure it has no impact if near and far plane values are swapped in dispatch params
// the flags "inverted" and "infinite" will decide what transform to use
@ -396,19 +400,19 @@ namespace FidelityFX
1.0f / cotHalfFovY);
}
private void SetupRcasConstants(Fsr2.DispatchDescription dispatchParams)
private void SetupRcasConstants(Fsr3Upscaler.DispatchDescription dispatchParams)
{
int sharpnessIndex = Mathf.RoundToInt(Mathf.Clamp01(dispatchParams.Sharpness) * (RcasConfigs.Length - 1));
RcasConsts = RcasConfigs[sharpnessIndex];
}
private void SetupSpdConstants(Fsr2.DispatchDescription dispatchParams, out Vector2Int dispatchThreadGroupCount)
private void SetupSpdConstants(Fsr3Upscaler.DispatchDescription dispatchParams, out Vector2Int dispatchThreadGroupCount)
{
RectInt rectInfo = new RectInt(0, 0, dispatchParams.RenderSize.x, dispatchParams.RenderSize.y);
SpdSetup(rectInfo, out dispatchThreadGroupCount, out var workGroupOffset, out var numWorkGroupsAndMips);
// Downsample
ref Fsr2.SpdConstants spdConstants = ref SpdConsts;
ref Fsr3Upscaler.SpdConstants spdConstants = ref SpdConsts;
spdConstants.numWorkGroups = (uint)numWorkGroupsAndMips.x;
spdConstants.mips = (uint)numWorkGroupsAndMips.y;
spdConstants.workGroupOffsetX = (uint)workGroupOffset.x;
@ -434,7 +438,7 @@ namespace FidelityFX
}
}
private void DebugCheckDispatch(Fsr2.DispatchDescription dispatchParams)
private void DebugCheckDispatch(Fsr3Upscaler.DispatchDescription dispatchParams)
{
if (!dispatchParams.Color.IsValid)
{
@ -456,7 +460,7 @@ namespace FidelityFX
Debug.LogError("Output resource is null");
}
if (dispatchParams.Exposure.IsValid && (_contextDescription.Flags & Fsr2.InitializationFlags.EnableAutoExposure) != 0)
if (dispatchParams.Exposure.IsValid && (_contextDescription.Flags & Fsr3Upscaler.InitializationFlags.EnableAutoExposure) != 0)
{
Debug.LogWarning("Exposure resource provided, however auto exposure flag is present");
}
@ -496,8 +500,8 @@ namespace FidelityFX
Debug.LogError("PreExposure provided as 0.0f which is invalid");
}
bool infiniteDepth = (_contextDescription.Flags & Fsr2.InitializationFlags.EnableDepthInfinite) != 0;
bool inverseDepth = (_contextDescription.Flags & Fsr2.InitializationFlags.EnableDepthInverted) != 0;
bool infiniteDepth = (_contextDescription.Flags & Fsr3Upscaler.InitializationFlags.EnableDepthInfinite) != 0;
bool inverseDepth = (_contextDescription.Flags & Fsr3Upscaler.InitializationFlags.EnableDepthInverted) != 0;
if (inverseDepth)
{
@ -552,32 +556,32 @@ namespace FidelityFX
}
/// <summary>
/// The FSR2 C++ codebase uses floats bitwise converted to ints to pass sharpness parameters to the RCAS shader.
/// The FSR3 C++ codebase uses floats bitwise converted to ints to pass sharpness parameters to the RCAS shader.
/// This is not possible in C# without enabling unsafe code compilation, so to avoid that we instead use a table of precomputed values.
/// </summary>
private static readonly Fsr2.RcasConstants[] RcasConfigs = new []
private static readonly Fsr3Upscaler.RcasConstants[] RcasConfigs = new []
{
new Fsr2.RcasConstants(1048576000u, 872428544u),
new Fsr2.RcasConstants(1049178080u, 877212745u),
new Fsr2.RcasConstants(1049823372u, 882390168u),
new Fsr2.RcasConstants(1050514979u, 887895276u),
new Fsr2.RcasConstants(1051256227u, 893859143u),
new Fsr2.RcasConstants(1052050675u, 900216232u),
new Fsr2.RcasConstants(1052902144u, 907032080u),
new Fsr2.RcasConstants(1053814727u, 914306687u),
new Fsr2.RcasConstants(1054792807u, 922105590u),
new Fsr2.RcasConstants(1055841087u, 930494326u),
new Fsr2.RcasConstants(1056964608u, 939538432u),
new Fsr2.RcasConstants(1057566688u, 944322633u),
new Fsr2.RcasConstants(1058211980u, 949500056u),
new Fsr2.RcasConstants(1058903587u, 955005164u),
new Fsr2.RcasConstants(1059644835u, 960969031u),
new Fsr2.RcasConstants(1060439283u, 967326120u),
new Fsr2.RcasConstants(1061290752u, 974141968u),
new Fsr2.RcasConstants(1062203335u, 981416575u),
new Fsr2.RcasConstants(1063181415u, 989215478u),
new Fsr2.RcasConstants(1064229695u, 997604214u),
new Fsr2.RcasConstants(1065353216u, 1006648320),
new Fsr3Upscaler.RcasConstants(1048576000u, 872428544u),
new Fsr3Upscaler.RcasConstants(1049178080u, 877212745u),
new Fsr3Upscaler.RcasConstants(1049823372u, 882390168u),
new Fsr3Upscaler.RcasConstants(1050514979u, 887895276u),
new Fsr3Upscaler.RcasConstants(1051256227u, 893859143u),
new Fsr3Upscaler.RcasConstants(1052050675u, 900216232u),
new Fsr3Upscaler.RcasConstants(1052902144u, 907032080u),
new Fsr3Upscaler.RcasConstants(1053814727u, 914306687u),
new Fsr3Upscaler.RcasConstants(1054792807u, 922105590u),
new Fsr3Upscaler.RcasConstants(1055841087u, 930494326u),
new Fsr3Upscaler.RcasConstants(1056964608u, 939538432u),
new Fsr3Upscaler.RcasConstants(1057566688u, 944322633u),
new Fsr3Upscaler.RcasConstants(1058211980u, 949500056u),
new Fsr3Upscaler.RcasConstants(1058903587u, 955005164u),
new Fsr3Upscaler.RcasConstants(1059644835u, 960969031u),
new Fsr3Upscaler.RcasConstants(1060439283u, 967326120u),
new Fsr3Upscaler.RcasConstants(1061290752u, 974141968u),
new Fsr3Upscaler.RcasConstants(1062203335u, 981416575u),
new Fsr3Upscaler.RcasConstants(1063181415u, 989215478u),
new Fsr3Upscaler.RcasConstants(1064229695u, 997604214u),
new Fsr3Upscaler.RcasConstants(1065353216u, 1006648320),
};
private static ComputeBuffer CreateConstantBuffer<TConstants>() where TConstants: struct
@ -594,7 +598,7 @@ namespace FidelityFX
bufferRef = null;
}
private static void DestroyPass(ref Fsr2Pass pass)
private static void DestroyPass(ref Fsr3UpscalerPass pass)
{
if (pass == null)
return;

3
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerContext.cs.meta

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 14c8dc4c7c3e4ac418e50a859cec0b2f
timeCreated: 1673442225

250
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR2/Fsr2Pass.cs → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerPass.cs

@ -26,24 +26,22 @@ using UnityEngine.Rendering;
namespace FidelityFX
{
/// <summary>
/// Base class for all of the compute passes that make up the FSR2 process.
/// This loosely matches the FfxPipelineState struct from the original FSR2 codebase, wrapped in an object-oriented blanket.
/// Base class for all of the compute passes that make up the FSR3 Upscaler process.
/// This loosely matches the FfxPipelineState struct from the original FSR3 codebase, wrapped in an object-oriented blanket.
/// These classes are responsible for loading compute shaders, managing temporary resources, binding resources to shader kernels and dispatching said shaders.
/// </summary>
internal abstract class Fsr2Pass: IDisposable
internal abstract class Fsr3UpscalerPass: IDisposable
{
internal const int ShadingChangeMipLevel = 4; // This matches the FFX_FSR2_SHADING_CHANGE_MIP_LEVEL define
internal const int ShadingChangeMipLevel = 4; // This matches the FFX_FSR3UPSCALER_SHADING_CHANGE_MIP_LEVEL define
protected readonly Fsr2.ContextDescription ContextDescription;
protected readonly Fsr2Resources Resources;
protected readonly Fsr3Upscaler.ContextDescription ContextDescription;
protected readonly Fsr3UpscalerResources Resources;
protected readonly ComputeBuffer Constants;
protected ComputeShader ComputeShader;
protected int KernelIndex;
protected virtual bool AllowFP16 => true;
protected Fsr2Pass(Fsr2.ContextDescription contextDescription, Fsr2Resources resources, ComputeBuffer constants)
protected Fsr3UpscalerPass(Fsr3Upscaler.ContextDescription contextDescription, Fsr3UpscalerResources resources, ComputeBuffer constants)
{
ContextDescription = contextDescription;
Resources = resources;
@ -55,14 +53,14 @@ namespace FidelityFX
UnloadComputeShader();
}
public abstract void ScheduleDispatch(CommandBuffer commandBuffer, Fsr2.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY);
public abstract void ScheduleDispatch(CommandBuffer commandBuffer, Fsr3Upscaler.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY);
protected void LoadComputeShader(string name)
{
LoadComputeShader(name, ContextDescription.Flags, ref ComputeShader, out KernelIndex);
}
private void LoadComputeShader(string name, Fsr2.InitializationFlags flags, ref ComputeShader shaderRef, out int kernelIndex)
private void LoadComputeShader(string name, Fsr3Upscaler.InitializationFlags flags, ref ComputeShader shaderRef, out int kernelIndex)
{
if (shaderRef == null)
{
@ -81,22 +79,19 @@ namespace FidelityFX
}
#endif
// Allow 16-bit floating point as a configuration option, except on passes that explicitly disable it
bool supportedFP16 = ((flags & Fsr2.InitializationFlags.EnableFP16Usage) != 0 && AllowFP16);
// This matches the permutation rules from the CreatePipeline* functions
if ((flags & Fsr2.InitializationFlags.EnableHighDynamicRange) != 0) shaderRef.EnableKeyword("FFX_FSR2_OPTION_HDR_COLOR_INPUT");
if ((flags & Fsr2.InitializationFlags.EnableDisplayResolutionMotionVectors) == 0) shaderRef.EnableKeyword("FFX_FSR2_OPTION_LOW_RESOLUTION_MOTION_VECTORS");
if ((flags & Fsr2.InitializationFlags.EnableMotionVectorsJitterCancellation) != 0) shaderRef.EnableKeyword("FFX_FSR2_OPTION_JITTERED_MOTION_VECTORS");
if ((flags & Fsr2.InitializationFlags.EnableDepthInverted) != 0) shaderRef.EnableKeyword("FFX_FSR2_OPTION_INVERTED_DEPTH");
if (useLut) shaderRef.EnableKeyword("FFX_FSR2_OPTION_REPROJECT_USE_LANCZOS_TYPE");
if (supportedFP16) shaderRef.EnableKeyword("FFX_HALF");
if ((flags & Fsr3Upscaler.InitializationFlags.EnableHighDynamicRange) != 0) shaderRef.EnableKeyword("FFX_FSR3UPSCALER_OPTION_HDR_COLOR_INPUT");
if ((flags & Fsr3Upscaler.InitializationFlags.EnableDisplayResolutionMotionVectors) == 0) shaderRef.EnableKeyword("FFX_FSR3UPSCALER_OPTION_LOW_RESOLUTION_MOTION_VECTORS");
if ((flags & Fsr3Upscaler.InitializationFlags.EnableMotionVectorsJitterCancellation) != 0) shaderRef.EnableKeyword("FFX_FSR3UPSCALER_OPTION_JITTERED_MOTION_VECTORS");
if ((flags & Fsr3Upscaler.InitializationFlags.EnableDepthInverted) != 0) shaderRef.EnableKeyword("FFX_FSR3UPSCALER_OPTION_INVERTED_DEPTH");
if (useLut) shaderRef.EnableKeyword("FFX_FSR3UPSCALER_OPTION_REPROJECT_USE_LANCZOS_TYPE");
if ((flags & Fsr3Upscaler.InitializationFlags.EnableFP16Usage) != 0) shaderRef.EnableKeyword("FFX_HALF");
// Inform the shader which render pipeline we're currently using
var pipeline = GraphicsSettings.currentRenderPipeline;
if (pipeline != null && pipeline.GetType().Name.Contains("HDRenderPipeline"))
{
shaderRef.EnableKeyword("UNITY_FSR2_HDRP");
shaderRef.EnableKeyword("UNITY_FSR3UPSCALER_HDRP");
}
}
@ -115,72 +110,72 @@ namespace FidelityFX
}
}
internal class Fsr2ComputeLuminancePyramidPass : Fsr2Pass
internal class Fsr3UpscalerComputeLuminancePyramidPass : Fsr3UpscalerPass
{
private readonly ComputeBuffer _spdConstants;
public Fsr2ComputeLuminancePyramidPass(Fsr2.ContextDescription contextDescription, Fsr2Resources resources, ComputeBuffer constants, ComputeBuffer spdConstants)
public Fsr3UpscalerComputeLuminancePyramidPass(Fsr3Upscaler.ContextDescription contextDescription, Fsr3UpscalerResources resources, ComputeBuffer constants, ComputeBuffer spdConstants)
: base(contextDescription, resources, constants)
{
_spdConstants = spdConstants;
LoadComputeShader("FSR2/ffx_fsr2_compute_luminance_pyramid_pass");
LoadComputeShader("FSR3/ffx_fsr3upscaler_compute_luminance_pyramid_pass");
}
public override void ScheduleDispatch(CommandBuffer commandBuffer, Fsr2.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY)
public override void ScheduleDispatch(CommandBuffer commandBuffer, Fsr3Upscaler.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY)
{
ref var color = ref dispatchParams.Color;
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvInputColor, color.RenderTarget, color.MipLevel, color.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvInputColor, color.RenderTarget, color.MipLevel, color.SubElement);
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, Fsr3ShaderIDs.UavSpdAtomicCount, Resources.SpdAtomicCounter);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavExposureMipLumaChange, Resources.SceneLuminance, ShadingChangeMipLevel);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavExposureMip5, Resources.SceneLuminance, 5);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavAutoExposure, Resources.AutoExposure);
commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr2ShaderIDs.CbFsr2, Constants, 0, Marshal.SizeOf<Fsr2.Fsr2Constants>());
commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr2ShaderIDs.CbSpd, _spdConstants, 0, Marshal.SizeOf<Fsr2.SpdConstants>());
commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr3ShaderIDs.CbFsr3Upscaler, Constants, 0, Marshal.SizeOf<Fsr3Upscaler.UpscalerConstants>());
commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr3ShaderIDs.CbSpd, _spdConstants, 0, Marshal.SizeOf<Fsr3Upscaler.SpdConstants>());
commandBuffer.DispatchCompute(ComputeShader, KernelIndex, dispatchX, dispatchY, 1);
}
}
internal class Fsr2ReconstructPreviousDepthPass : Fsr2Pass
internal class Fsr3UpscalerReconstructPreviousDepthPass : Fsr3UpscalerPass
{
public Fsr2ReconstructPreviousDepthPass(Fsr2.ContextDescription contextDescription, Fsr2Resources resources, ComputeBuffer constants)
public Fsr3UpscalerReconstructPreviousDepthPass(Fsr3Upscaler.ContextDescription contextDescription, Fsr3UpscalerResources resources, ComputeBuffer constants)
: base(contextDescription, resources, constants)
{
LoadComputeShader("FSR2/ffx_fsr2_reconstruct_previous_depth_pass");
LoadComputeShader("FSR3/ffx_fsr3upscaler_reconstruct_previous_depth_pass");
}
public override void ScheduleDispatch(CommandBuffer commandBuffer, Fsr2.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY)
public override void ScheduleDispatch(CommandBuffer commandBuffer, Fsr3Upscaler.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY)
{
ref var color = ref dispatchParams.Color;
ref var depth = ref dispatchParams.Depth;
ref var motionVectors = ref dispatchParams.MotionVectors;
ref var exposure = ref dispatchParams.Exposure;
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvInputColor, color.RenderTarget, color.MipLevel, color.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvInputDepth, depth.RenderTarget, depth.MipLevel, depth.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvInputMotionVectors, motionVectors.RenderTarget, motionVectors.MipLevel, motionVectors.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvInputExposure, exposure.RenderTarget, exposure.MipLevel, exposure.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvInputColor, color.RenderTarget, color.MipLevel, color.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvInputDepth, depth.RenderTarget, depth.MipLevel, depth.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvInputMotionVectors, motionVectors.RenderTarget, motionVectors.MipLevel, motionVectors.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvInputExposure, exposure.RenderTarget, exposure.MipLevel, exposure.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.UavDilatedMotionVectors, Resources.DilatedMotionVectors[frameIndex]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavDilatedMotionVectors, Resources.DilatedMotionVectors[frameIndex]);
commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr2ShaderIDs.CbFsr2, Constants, 0, Marshal.SizeOf<Fsr2.Fsr2Constants>());
commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr3ShaderIDs.CbFsr3Upscaler, Constants, 0, Marshal.SizeOf<Fsr3Upscaler.UpscalerConstants>());
commandBuffer.DispatchCompute(ComputeShader, KernelIndex, dispatchX, dispatchY, 1);
}
}
internal class Fsr2DepthClipPass : Fsr2Pass
internal class Fsr3UpscalerDepthClipPass : Fsr3UpscalerPass
{
public Fsr2DepthClipPass(Fsr2.ContextDescription contextDescription, Fsr2Resources resources, ComputeBuffer constants)
public Fsr3UpscalerDepthClipPass(Fsr3Upscaler.ContextDescription contextDescription, Fsr3UpscalerResources resources, ComputeBuffer constants)
: base(contextDescription, resources, constants)
{
LoadComputeShader("FSR2/ffx_fsr2_depth_clip_pass");
LoadComputeShader("FSR3/ffx_fsr3upscaler_depth_clip_pass");
}
public override void ScheduleDispatch(CommandBuffer commandBuffer, Fsr2.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY)
public override void ScheduleDispatch(CommandBuffer commandBuffer, Fsr3Upscaler.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY)
{
ref var color = ref dispatchParams.Color;
ref var depth = ref dispatchParams.Depth;
@ -189,62 +184,59 @@ namespace FidelityFX
ref var reactive = ref dispatchParams.Reactive;
ref var tac = ref dispatchParams.TransparencyAndComposition;
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvInputColor, color.RenderTarget, color.MipLevel, color.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvInputDepth, depth.RenderTarget, depth.MipLevel, depth.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvInputMotionVectors, motionVectors.RenderTarget, motionVectors.MipLevel, motionVectors.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvInputExposure, exposure.RenderTarget, exposure.MipLevel, exposure.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvReactiveMask, reactive.RenderTarget, reactive.MipLevel, reactive.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvTransparencyAndCompositionMask, tac.RenderTarget, tac.MipLevel, tac.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvReconstructedPrevNearestDepth, Fsr2ShaderIDs.UavReconstructedPrevNearestDepth);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvDilatedMotionVectors, Resources.DilatedMotionVectors[frameIndex]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvDilatedDepth, Fsr2ShaderIDs.UavDilatedDepth);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvPrevDilatedMotionVectors, Resources.DilatedMotionVectors[frameIndex ^ 1]);
commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr2ShaderIDs.CbFsr2, Constants, 0, Marshal.SizeOf<Fsr2.Fsr2Constants>());
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvInputColor, color.RenderTarget, color.MipLevel, color.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvInputDepth, depth.RenderTarget, depth.MipLevel, depth.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvInputMotionVectors, motionVectors.RenderTarget, motionVectors.MipLevel, motionVectors.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvInputExposure, exposure.RenderTarget, exposure.MipLevel, exposure.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvReactiveMask, reactive.RenderTarget, reactive.MipLevel, reactive.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvTransparencyAndCompositionMask, tac.RenderTarget, tac.MipLevel, tac.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvReconstructedPrevNearestDepth, Fsr3ShaderIDs.UavReconstructedPrevNearestDepth);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvDilatedMotionVectors, Resources.DilatedMotionVectors[frameIndex]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvDilatedDepth, Fsr3ShaderIDs.UavDilatedDepth);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvPrevDilatedMotionVectors, Resources.DilatedMotionVectors[frameIndex ^ 1]);
commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr3ShaderIDs.CbFsr3Upscaler, Constants, 0, Marshal.SizeOf<Fsr3Upscaler.UpscalerConstants>());
commandBuffer.DispatchCompute(ComputeShader, KernelIndex, dispatchX, dispatchY, 1);
}
}
internal class Fsr2LockPass : Fsr2Pass
internal class Fsr3UpscalerLockPass : Fsr3UpscalerPass
{
public Fsr2LockPass(Fsr2.ContextDescription contextDescription, Fsr2Resources resources, ComputeBuffer constants)
public Fsr3UpscalerLockPass(Fsr3Upscaler.ContextDescription contextDescription, Fsr3UpscalerResources resources, ComputeBuffer constants)
: base(contextDescription, resources, constants)
{
LoadComputeShader("FSR2/ffx_fsr2_lock_pass");
LoadComputeShader("FSR3/ffx_fsr3upscaler_lock_pass");
}
public override void ScheduleDispatch(CommandBuffer commandBuffer, Fsr2.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY)
public override void ScheduleDispatch(CommandBuffer commandBuffer, Fsr3Upscaler.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY)
{
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvLockInputLuma, Fsr2ShaderIDs.UavLockInputLuma);
commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr2ShaderIDs.CbFsr2, Constants, 0, Marshal.SizeOf<Fsr2.Fsr2Constants>());
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvLockInputLuma, Fsr3ShaderIDs.UavLockInputLuma);
commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr3ShaderIDs.CbFsr3Upscaler, Constants, 0, Marshal.SizeOf<Fsr3Upscaler.UpscalerConstants>());
commandBuffer.DispatchCompute(ComputeShader, KernelIndex, dispatchX, dispatchY, 1);
}
}
internal class Fsr2AccumulatePass : Fsr2Pass
internal class Fsr3UpscalerAccumulatePass : Fsr3UpscalerPass
{
private const string SharpeningKeyword = "FFX_FSR2_OPTION_APPLY_SHARPENING";
// Workaround: Disable FP16 path for the accumulate pass on NVIDIA due to reduced occupancy and high VRAM throughput.
protected override bool AllowFP16 => SystemInfo.graphicsDeviceVendorID != 0x10DE;
private const string SharpeningKeyword = "FFX_FSR3UPSCALER_OPTION_APPLY_SHARPENING";
#if UNITY_2021_2_OR_NEWER
private readonly LocalKeyword _sharpeningKeyword;
#endif
public Fsr2AccumulatePass(Fsr2.ContextDescription contextDescription, Fsr2Resources resources, ComputeBuffer constants)
public Fsr3UpscalerAccumulatePass(Fsr3Upscaler.ContextDescription contextDescription, Fsr3UpscalerResources resources, ComputeBuffer constants)
: base(contextDescription, resources, constants)
{
LoadComputeShader("FSR2/ffx_fsr2_accumulate_pass");
LoadComputeShader("FSR3/ffx_fsr3upscaler_accumulate_pass");
#if UNITY_2021_2_OR_NEWER
_sharpeningKeyword = new LocalKeyword(ComputeShader, SharpeningKeyword);
#endif
}
public override void ScheduleDispatch(CommandBuffer commandBuffer, Fsr2.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY)
public override void ScheduleDispatch(CommandBuffer commandBuffer, Fsr3Upscaler.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY)
{
#if UNITY_2021_2_OR_NEWER
if (dispatchParams.EnableSharpening)
@ -258,115 +250,115 @@ namespace FidelityFX
commandBuffer.DisableShaderKeyword(SharpeningKeyword);
#endif
if ((ContextDescription.Flags & Fsr2.InitializationFlags.EnableDisplayResolutionMotionVectors) == 0)
if ((ContextDescription.Flags & Fsr3Upscaler.InitializationFlags.EnableDisplayResolutionMotionVectors) == 0)
{
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvDilatedMotionVectors, Resources.DilatedMotionVectors[frameIndex]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvDilatedMotionVectors, Resources.DilatedMotionVectors[frameIndex]);
}
else
{
ref var motionVectors = ref dispatchParams.MotionVectors;
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvInputMotionVectors, motionVectors.RenderTarget, motionVectors.MipLevel, motionVectors.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvInputMotionVectors, motionVectors.RenderTarget, motionVectors.MipLevel, motionVectors.SubElement);
}
ref var exposure = ref dispatchParams.Exposure;
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvInputExposure, exposure.RenderTarget, exposure.MipLevel, exposure.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvDilatedReactiveMasks, Fsr2ShaderIDs.UavDilatedReactiveMasks);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvInternalUpscaled, Resources.InternalUpscaled[frameIndex ^ 1]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvLockStatus, Resources.LockStatus[frameIndex ^ 1]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvPreparedInputColor, Fsr2ShaderIDs.UavPreparedInputColor);
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.SrvLumaHistory, Resources.LumaHistory[frameIndex ^ 1]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.UavInternalUpscaled, Resources.InternalUpscaled[frameIndex]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.UavLockStatus, Resources.LockStatus[frameIndex]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.UavLumaHistory, Resources.LumaHistory[frameIndex]);
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.SrvInternalUpscaled, Resources.InternalUpscaled[frameIndex ^ 1]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvLockStatus, Resources.LockStatus[frameIndex ^ 1]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvPreparedInputColor, Fsr3ShaderIDs.UavPreparedInputColor);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvLanczosLut, Resources.LanczosLut);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvUpscaleMaximumBiasLut, Resources.MaximumBiasLut);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvSceneLuminanceMips, Resources.SceneLuminance);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvAutoExposure, Resources.AutoExposure);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvLumaHistory, Resources.LumaHistory[frameIndex ^ 1]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavInternalUpscaled, Resources.InternalUpscaled[frameIndex]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavLockStatus, Resources.LockStatus[frameIndex]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavLumaHistory, Resources.LumaHistory[frameIndex]);
ref var output = ref dispatchParams.Output;
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.UavUpscaledOutput, output.RenderTarget, output.MipLevel, output.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavUpscaledOutput, output.RenderTarget, output.MipLevel, output.SubElement);
commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr2ShaderIDs.CbFsr2, Constants, 0, Marshal.SizeOf<Fsr2.Fsr2Constants>());
commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr3ShaderIDs.CbFsr3Upscaler, Constants, 0, Marshal.SizeOf<Fsr3Upscaler.UpscalerConstants>());
commandBuffer.DispatchCompute(ComputeShader, KernelIndex, dispatchX, dispatchY, 1);
}
}
internal class Fsr2RcasPass : Fsr2Pass
internal class Fsr3UpscalerRcasPass : Fsr3UpscalerPass
{
private readonly ComputeBuffer _rcasConstants;
public Fsr2RcasPass(Fsr2.ContextDescription contextDescription, Fsr2Resources resources, ComputeBuffer constants, ComputeBuffer rcasConstants)
public Fsr3UpscalerRcasPass(Fsr3Upscaler.ContextDescription contextDescription, Fsr3UpscalerResources resources, ComputeBuffer constants, ComputeBuffer rcasConstants)
: base(contextDescription, resources, constants)
{
_rcasConstants = rcasConstants;
LoadComputeShader("FSR2/ffx_fsr2_rcas_pass");
LoadComputeShader("FSR3/ffx_fsr3upscaler_rcas_pass");
}
public override void ScheduleDispatch(CommandBuffer commandBuffer, Fsr2.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY)
public override void ScheduleDispatch(CommandBuffer commandBuffer, Fsr3Upscaler.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY)
{
ref var exposure = ref dispatchParams.Exposure;
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvInputExposure, exposure.RenderTarget, exposure.MipLevel, exposure.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvRcasInput, Resources.InternalUpscaled[frameIndex]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvInputExposure, exposure.RenderTarget, exposure.MipLevel, exposure.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvRcasInput, Resources.InternalUpscaled[frameIndex]);
ref var output = ref dispatchParams.Output;
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.UavUpscaledOutput, output.RenderTarget, output.MipLevel, output.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavUpscaledOutput, output.RenderTarget, output.MipLevel, output.SubElement);
commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr2ShaderIDs.CbFsr2, Constants, 0, Marshal.SizeOf<Fsr2.Fsr2Constants>());
commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr2ShaderIDs.CbRcas, _rcasConstants, 0, Marshal.SizeOf<Fsr2.RcasConstants>());
commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr3ShaderIDs.CbFsr3Upscaler, Constants, 0, Marshal.SizeOf<Fsr3Upscaler.UpscalerConstants>());
commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr3ShaderIDs.CbRcas, _rcasConstants, 0, Marshal.SizeOf<Fsr3Upscaler.RcasConstants>());
commandBuffer.DispatchCompute(ComputeShader, KernelIndex, dispatchX, dispatchY, 1);
}
}
internal class Fsr2GenerateReactivePass : Fsr2Pass
internal class Fsr3UpscalerGenerateReactivePass : Fsr3UpscalerPass
{
private readonly ComputeBuffer _generateReactiveConstants;
public Fsr2GenerateReactivePass(Fsr2.ContextDescription contextDescription, Fsr2Resources resources, ComputeBuffer generateReactiveConstants)
public Fsr3UpscalerGenerateReactivePass(Fsr3Upscaler.ContextDescription contextDescription, Fsr3UpscalerResources resources, ComputeBuffer generateReactiveConstants)
: base(contextDescription, resources, null)
{
_generateReactiveConstants = generateReactiveConstants;
LoadComputeShader("FSR2/ffx_fsr2_autogen_reactive_pass");
LoadComputeShader("FSR3/ffx_fsr3upscaler_autogen_reactive_pass");
}
public override void ScheduleDispatch(CommandBuffer commandBuffer, Fsr2.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY)
public override void ScheduleDispatch(CommandBuffer commandBuffer, Fsr3Upscaler.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY)
{
}
public void ScheduleDispatch(CommandBuffer commandBuffer, Fsr2.GenerateReactiveDescription dispatchParams, int dispatchX, int dispatchY)
public void ScheduleDispatch(CommandBuffer commandBuffer, Fsr3Upscaler.GenerateReactiveDescription dispatchParams, int dispatchX, int dispatchY)
{
ref var opaqueOnly = ref dispatchParams.ColorOpaqueOnly;
ref var color = ref dispatchParams.ColorPreUpscale;
ref var reactive = ref dispatchParams.OutReactive;
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvOpaqueOnly, opaqueOnly.RenderTarget, opaqueOnly.MipLevel, opaqueOnly.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvInputColor, color.RenderTarget, color.MipLevel, color.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.UavAutoReactive, reactive.RenderTarget, reactive.MipLevel, reactive.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvOpaqueOnly, opaqueOnly.RenderTarget, opaqueOnly.MipLevel, opaqueOnly.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvInputColor, color.RenderTarget, color.MipLevel, color.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavAutoReactive, reactive.RenderTarget, reactive.MipLevel, reactive.SubElement);
commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr2ShaderIDs.CbGenReactive, _generateReactiveConstants, 0, Marshal.SizeOf<Fsr2.GenerateReactiveConstants>());
commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr3ShaderIDs.CbGenReactive, _generateReactiveConstants, 0, Marshal.SizeOf<Fsr3Upscaler.GenerateReactiveConstants>());
commandBuffer.DispatchCompute(ComputeShader, KernelIndex, dispatchX, dispatchY, 1);
}
}
internal class Fsr2TcrAutogeneratePass : Fsr2Pass
internal class Fsr3UpscalerTcrAutogeneratePass : Fsr3UpscalerPass
{
private readonly ComputeBuffer _tcrAutogenerateConstants;
public Fsr2TcrAutogeneratePass(Fsr2.ContextDescription contextDescription, Fsr2Resources resources, ComputeBuffer constants, ComputeBuffer tcrAutogenerateConstants)
public Fsr3UpscalerTcrAutogeneratePass(Fsr3Upscaler.ContextDescription contextDescription, Fsr3UpscalerResources resources, ComputeBuffer constants, ComputeBuffer tcrAutogenerateConstants)
: base(contextDescription, resources, constants)
{
_tcrAutogenerateConstants = tcrAutogenerateConstants;
LoadComputeShader("FSR2/ffx_fsr2_tcr_autogen_pass");
LoadComputeShader("FSR3/ffx_fsr3upscaler_tcr_autogen_pass");
}
public override void ScheduleDispatch(CommandBuffer commandBuffer, Fsr2.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY)
public override void ScheduleDispatch(CommandBuffer commandBuffer, Fsr3Upscaler.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY)
{
ref var color = ref dispatchParams.Color;
ref var motionVectors = ref dispatchParams.MotionVectors;
@ -374,21 +366,21 @@ namespace FidelityFX
ref var reactive = ref dispatchParams.Reactive;
ref var tac = ref dispatchParams.TransparencyAndComposition;
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvOpaqueOnly, opaqueOnly.RenderTarget, opaqueOnly.MipLevel, opaqueOnly.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvInputColor, color.RenderTarget, color.MipLevel, color.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvInputMotionVectors, motionVectors.RenderTarget, motionVectors.MipLevel, motionVectors.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvPrevColorPreAlpha, Resources.PrevPreAlpha[frameIndex ^ 1]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvPrevColorPostAlpha, Resources.PrevPostAlpha[frameIndex ^ 1]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvReactiveMask, reactive.RenderTarget, reactive.MipLevel, reactive.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvTransparencyAndCompositionMask, tac.RenderTarget, tac.MipLevel, tac.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.UavAutoReactive, Resources.AutoReactive);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.UavAutoComposition, Resources.AutoComposition);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.UavPrevColorPreAlpha, Resources.PrevPreAlpha[frameIndex]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.UavPrevColorPostAlpha, Resources.PrevPostAlpha[frameIndex]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvOpaqueOnly, opaqueOnly.RenderTarget, opaqueOnly.MipLevel, opaqueOnly.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvInputColor, color.RenderTarget, color.MipLevel, color.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvInputMotionVectors, motionVectors.RenderTarget, motionVectors.MipLevel, motionVectors.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvPrevColorPreAlpha, Resources.PrevPreAlpha[frameIndex ^ 1]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvPrevColorPostAlpha, Resources.PrevPostAlpha[frameIndex ^ 1]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvReactiveMask, reactive.RenderTarget, reactive.MipLevel, reactive.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvTransparencyAndCompositionMask, tac.RenderTarget, tac.MipLevel, tac.SubElement);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavAutoReactive, Resources.AutoReactive);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavAutoComposition, Resources.AutoComposition);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavPrevColorPreAlpha, Resources.PrevPreAlpha[frameIndex]);
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavPrevColorPostAlpha, Resources.PrevPostAlpha[frameIndex]);
commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr2ShaderIDs.CbFsr2, Constants, 0, Marshal.SizeOf<Fsr2.Fsr2Constants>());
commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr2ShaderIDs.CbGenReactive, _tcrAutogenerateConstants, 0, Marshal.SizeOf<Fsr2.GenerateReactiveConstants2>());
commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr3ShaderIDs.CbFsr3Upscaler, Constants, 0, Marshal.SizeOf<Fsr3Upscaler.UpscalerConstants>());
commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr3ShaderIDs.CbGenReactive, _tcrAutogenerateConstants, 0, Marshal.SizeOf<Fsr3Upscaler.GenerateReactiveConstants2>());
commandBuffer.DispatchCompute(ComputeShader, KernelIndex, dispatchX, dispatchY, 1);
}

3
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerPass.cs.meta

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: cfd077da533b192458b0b548668776e7
timeCreated: 1676885169

110
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR2/Fsr2Resources.cs → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerResources.cs

@ -26,10 +26,10 @@ using UnityEngine.Rendering;
namespace FidelityFX
{
/// <summary>
/// Helper class for bundling and managing persistent resources required by the FSR2 process.
/// Helper class for bundling and managing persistent resources required by the FSR3 Upscaler process.
/// This includes lookup tables, default fallback resources and double-buffered resources that get swapped between frames.
/// </summary>
internal class Fsr2Resources
internal class Fsr3UpscalerResources
{
public Texture2D DefaultExposure;
public Texture2D DefaultReactive;
@ -47,7 +47,7 @@ namespace FidelityFX
public readonly RenderTexture[] PrevPreAlpha = new RenderTexture[2];
public readonly RenderTexture[] PrevPostAlpha = new RenderTexture[2];
public void Create(Fsr2.ContextDescription contextDescription)
public void Create(Fsr3Upscaler.ContextDescription contextDescription)
{
// Generate the data for the LUT
const int lanczos2LutWidth = 128;
@ -55,7 +55,7 @@ namespace FidelityFX
for (int currentLanczosWidthIndex = 0; currentLanczosWidthIndex < lanczos2LutWidth; ++currentLanczosWidthIndex)
{
float x = 2.0f * currentLanczosWidthIndex / (lanczos2LutWidth - 1);
float y = Fsr2.Lanczos2(x);
float y = Fsr3Upscaler.Lanczos2(x);
lanczos2Weights[currentLanczosWidthIndex] = y;
}
@ -65,108 +65,108 @@ namespace FidelityFX
maximumBias[i] = MaximumBias[i] / 2.0f;
}
// Resource FSR2_LanczosLutData: FFX_RESOURCE_USAGE_READ_ONLY, FFX_SURFACE_FORMAT_R16_SNORM, FFX_RESOURCE_FLAGS_NONE
// Resource FSR3UPSCALER_LanczosLutData: FFX_RESOURCE_USAGE_READ_ONLY, FFX_SURFACE_FORMAT_R16_SNORM, FFX_RESOURCE_FLAGS_NONE
// R16_SNorm textures are not supported by Unity on most platforms, strangely enough. So instead we use R32_SFloat and upload pre-normalized float data.
LanczosLut = new Texture2D(lanczos2LutWidth, 1, GraphicsFormat.R32_SFloat, TextureCreationFlags.None) { name = "FSR2_LanczosLutData" };
LanczosLut = new Texture2D(lanczos2LutWidth, 1, GraphicsFormat.R32_SFloat, TextureCreationFlags.None) { name = "FSR3UPSCALER_LanczosLutData" };
LanczosLut.SetPixelData(lanczos2Weights, 0);
LanczosLut.Apply();
// Resource FSR2_MaximumUpsampleBias: FFX_RESOURCE_USAGE_READ_ONLY, FFX_SURFACE_FORMAT_R16_SNORM, FFX_RESOURCE_FLAGS_NONE
MaximumBiasLut = new Texture2D(MaximumBiasTextureWidth, MaximumBiasTextureHeight, GraphicsFormat.R32_SFloat, TextureCreationFlags.None) { name = "FSR2_MaximumUpsampleBias" };
// Resource FSR3UPSCALER_MaximumUpsampleBias: FFX_RESOURCE_USAGE_READ_ONLY, FFX_SURFACE_FORMAT_R16_SNORM, FFX_RESOURCE_FLAGS_NONE
MaximumBiasLut = new Texture2D(MaximumBiasTextureWidth, MaximumBiasTextureHeight, GraphicsFormat.R32_SFloat, TextureCreationFlags.None) { name = "FSR3UPSCALER_MaximumUpsampleBias" };
MaximumBiasLut.SetPixelData(maximumBias, 0);
MaximumBiasLut.Apply();
// Resource FSR2_DefaultExposure: FFX_RESOURCE_USAGE_READ_ONLY, FFX_SURFACE_FORMAT_R32G32_FLOAT, FFX_RESOURCE_FLAGS_NONE
DefaultExposure = new Texture2D(1, 1, GraphicsFormat.R32G32_SFloat, TextureCreationFlags.None) { name = "FSR2_DefaultExposure" };
// Resource FSR3UPSCALER_DefaultExposure: FFX_RESOURCE_USAGE_READ_ONLY, FFX_SURFACE_FORMAT_R32G32_FLOAT, FFX_RESOURCE_FLAGS_NONE
DefaultExposure = new Texture2D(1, 1, GraphicsFormat.R32G32_SFloat, TextureCreationFlags.None) { name = "FSR3UPSCALER_DefaultExposure" };
DefaultExposure.SetPixel(0, 0, Color.clear);
DefaultExposure.Apply();
// Resource FSR2_DefaultReactivityMask: FFX_RESOURCE_USAGE_READ_ONLY, FFX_SURFACE_FORMAT_R8_UNORM, FFX_RESOURCE_FLAGS_NONE
DefaultReactive = new Texture2D(1, 1, GraphicsFormat.R8_UNorm, TextureCreationFlags.None) { name = "FSR2_DefaultReactivityMask" };
// Resource FSR3UPSCALER_DefaultReactivityMask: FFX_RESOURCE_USAGE_READ_ONLY, FFX_SURFACE_FORMAT_R8_UNORM, FFX_RESOURCE_FLAGS_NONE
DefaultReactive = new Texture2D(1, 1, GraphicsFormat.R8_UNorm, TextureCreationFlags.None) { name = "FSR3UPSCALER_DefaultReactivityMask" };
DefaultReactive.SetPixel(0, 0, Color.clear);
DefaultReactive.Apply();
// Resource FSR2_SpdAtomicCounter: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R32_UINT, FFX_RESOURCE_FLAGS_ALIASABLE
// Despite what the original FSR2 codebase says, this resource really isn't aliasable. Resetting this counter to 0 every frame breaks auto-exposure on MacOS Metal.
SpdAtomicCounter = new RenderTexture(1, 1, 0, GraphicsFormat.R32_UInt) { name = "FSR2_SpdAtomicCounter", enableRandomWrite = true };
// Resource FSR3UPSCALER_SpdAtomicCounter: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R32_UINT, FFX_RESOURCE_FLAGS_ALIASABLE
// Despite what the original FSR3 codebase says, this resource really isn't aliasable. Resetting this counter to 0 every frame breaks auto-exposure on MacOS Metal.
SpdAtomicCounter = new RenderTexture(1, 1, 0, GraphicsFormat.R32_UInt) { name = "FSR3UPSCALER_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 };
// Resource FSR3UPSCALER_AutoExposure: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R32G32_FLOAT, FFX_RESOURCE_FLAGS_NONE
AutoExposure = new RenderTexture(1, 1, 0, GraphicsFormat.R32G32_SFloat) { name = "FSR3UPSCALER_AutoExposure", enableRandomWrite = true };
AutoExposure.Create();
// Resource FSR2_ExposureMips: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R16_FLOAT, FFX_RESOURCE_FLAGS_ALIASABLE
// Resource FSR3UPSCALER_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;
int mipCount = 1 + Mathf.FloorToInt(Mathf.Log(Math.Max(w, h), 2.0f));
SceneLuminance = new RenderTexture(w, h, 0, GraphicsFormat.R16_SFloat, mipCount) { name = "FSR2_ExposureMips", enableRandomWrite = true, useMipMap = true, autoGenerateMips = false };
SceneLuminance = new RenderTexture(w, h, 0, GraphicsFormat.R16_SFloat, mipCount) { name = "FSR3UPSCALER_ExposureMips", enableRandomWrite = true, useMipMap = true, autoGenerateMips = false };
SceneLuminance.Create();
// 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);
// Resources FSR3UPSCALER_InternalDilatedVelocity1/2: FFX_RESOURCE_USAGE_RENDERTARGET | FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R16G16_FLOAT, FFX_RESOURCE_FLAGS_NONE
CreateDoubleBufferedResource(DilatedMotionVectors, "FSR3UPSCALER_InternalDilatedVelocity", contextDescription.MaxRenderSize, GraphicsFormat.R16G16_SFloat);
// Resources FSR2_LockStatus1/2: FFX_RESOURCE_USAGE_RENDERTARGET | FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R16G16_FLOAT, FFX_RESOURCE_FLAGS_NONE
CreateDoubleBufferedResource(LockStatus, "FSR2_LockStatus", contextDescription.DisplaySize, GraphicsFormat.R16G16_SFloat);
// Resources FSR3UPSCALER_LockStatus1/2: FFX_RESOURCE_USAGE_RENDERTARGET | FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R16G16_FLOAT, FFX_RESOURCE_FLAGS_NONE
CreateDoubleBufferedResource(LockStatus, "FSR3UPSCALER_LockStatus", contextDescription.DisplaySize, GraphicsFormat.R16G16_SFloat);
// Resources FSR2_InternalUpscaled1/2: FFX_RESOURCE_USAGE_RENDERTARGET | FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R16G16B16A16_FLOAT, FFX_RESOURCE_FLAGS_NONE
CreateDoubleBufferedResource(InternalUpscaled, "FSR2_InternalUpscaled", contextDescription.DisplaySize, GraphicsFormat.R16G16B16A16_SFloat);
// Resources FSR3UPSCALER_InternalUpscaled1/2: FFX_RESOURCE_USAGE_RENDERTARGET | FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R16G16B16A16_FLOAT, FFX_RESOURCE_FLAGS_NONE
CreateDoubleBufferedResource(InternalUpscaled, "FSR3UPSCALER_InternalUpscaled", contextDescription.DisplaySize, GraphicsFormat.R16G16B16A16_SFloat);
// Resources FSR2_LumaHistory1/2: FFX_RESOURCE_USAGE_RENDERTARGET | FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R8G8B8A8_UNORM, FFX_RESOURCE_FLAGS_NONE
CreateDoubleBufferedResource(LumaHistory, "FSR2_LumaHistory", contextDescription.DisplaySize, GraphicsFormat.R8G8B8A8_UNorm);
// Resources FSR3UPSCALER_LumaHistory1/2: FFX_RESOURCE_USAGE_RENDERTARGET | FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R8G8B8A8_UNORM, FFX_RESOURCE_FLAGS_NONE
CreateDoubleBufferedResource(LumaHistory, "FSR3UPSCALER_LumaHistory", contextDescription.DisplaySize, GraphicsFormat.R8G8B8A8_UNorm);
}
public void CreateTcrAutogenResources(Fsr2.ContextDescription contextDescription)
public void CreateTcrAutogenResources(Fsr3Upscaler.ContextDescription contextDescription)
{
// Resource FSR2_AutoReactive: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R8_UNORM, FFX_RESOURCE_FLAGS_NONE
AutoReactive = new RenderTexture(contextDescription.MaxRenderSize.x, contextDescription.MaxRenderSize.y, 0, GraphicsFormat.R8_UNorm) { name = "FSR2_AutoReactive", enableRandomWrite = true };
// Resource FSR3UPSCALER_AutoReactive: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R8_UNORM, FFX_RESOURCE_FLAGS_NONE
AutoReactive = new RenderTexture(contextDescription.MaxRenderSize.x, contextDescription.MaxRenderSize.y, 0, GraphicsFormat.R8_UNorm) { name = "FSR3UPSCALER_AutoReactive", enableRandomWrite = true };
AutoReactive.Create();
// Resource FSR2_AutoComposition: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R8_UNORM, FFX_RESOURCE_FLAGS_NONE
AutoComposition = new RenderTexture(contextDescription.MaxRenderSize.x, contextDescription.MaxRenderSize.y, 0, GraphicsFormat.R8_UNorm) { name = "FSR2_AutoComposition", enableRandomWrite = true };
// Resource FSR3UPSCALER_AutoComposition: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R8_UNORM, FFX_RESOURCE_FLAGS_NONE
AutoComposition = new RenderTexture(contextDescription.MaxRenderSize.x, contextDescription.MaxRenderSize.y, 0, GraphicsFormat.R8_UNorm) { name = "FSR3UPSCALER_AutoComposition", enableRandomWrite = true };
AutoComposition.Create();
// Resources FSR2_PrevPreAlpha0/1: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R11G11B10_FLOAT, FFX_RESOURCE_FLAGS_NONE
CreateDoubleBufferedResource(PrevPreAlpha, "FSR2_PrevPreAlpha", contextDescription.MaxRenderSize, GraphicsFormat.B10G11R11_UFloatPack32);
// Resources FSR3UPSCALER_PrevPreAlpha0/1: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R11G11B10_FLOAT, FFX_RESOURCE_FLAGS_NONE
CreateDoubleBufferedResource(PrevPreAlpha, "FSR3UPSCALER_PrevPreAlpha", contextDescription.MaxRenderSize, GraphicsFormat.B10G11R11_UFloatPack32);
// Resources FSR2_PrevPostAlpha0/1: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R11G11B10_FLOAT, FFX_RESOURCE_FLAGS_NONE
CreateDoubleBufferedResource(PrevPostAlpha, "FSR2_PrevPostAlpha", contextDescription.MaxRenderSize, GraphicsFormat.B10G11R11_UFloatPack32);
// Resources FSR3UPSCALER_PrevPostAlpha0/1: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R11G11B10_FLOAT, FFX_RESOURCE_FLAGS_NONE
CreateDoubleBufferedResource(PrevPostAlpha, "FSR3UPSCALER_PrevPostAlpha", contextDescription.MaxRenderSize, GraphicsFormat.B10G11R11_UFloatPack32);
}
// Set up shared aliasable resources, i.e. temporary render textures
// These do not need to persist between frames, but they do need to be available between passes
public static void CreateAliasableResources(CommandBuffer commandBuffer, Fsr2.ContextDescription contextDescription, Fsr2.DispatchDescription dispatchParams)
public static void CreateAliasableResources(CommandBuffer commandBuffer, Fsr3Upscaler.ContextDescription contextDescription, Fsr3Upscaler.DispatchDescription dispatchParams)
{
Vector2Int displaySize = contextDescription.DisplaySize;
Vector2Int maxRenderSize = contextDescription.MaxRenderSize;
// FSR2_ReconstructedPrevNearestDepth: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R32_UINT, FFX_RESOURCE_FLAGS_ALIASABLE
commandBuffer.GetTemporaryRT(Fsr2ShaderIDs.UavReconstructedPrevNearestDepth, maxRenderSize.x, maxRenderSize.y, 0, default, GraphicsFormat.R32_UInt, 1, true);
// FSR3UPSCALER_ReconstructedPrevNearestDepth: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R32_UINT, FFX_RESOURCE_FLAGS_ALIASABLE
commandBuffer.GetTemporaryRT(Fsr3ShaderIDs.UavReconstructedPrevNearestDepth, maxRenderSize.x, maxRenderSize.y, 0, default, GraphicsFormat.R32_UInt, 1, true);
// FSR2_DilatedDepth: FFX_RESOURCE_USAGE_RENDERTARGET | FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R32_FLOAT, FFX_RESOURCE_FLAGS_ALIASABLE
commandBuffer.GetTemporaryRT(Fsr2ShaderIDs.UavDilatedDepth, maxRenderSize.x, maxRenderSize.y, 0, default, GraphicsFormat.R32_SFloat, 1, true);
// FSR3UPSCALER_DilatedDepth: FFX_RESOURCE_USAGE_RENDERTARGET | FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R32_FLOAT, FFX_RESOURCE_FLAGS_ALIASABLE
commandBuffer.GetTemporaryRT(Fsr3ShaderIDs.UavDilatedDepth, maxRenderSize.x, maxRenderSize.y, 0, default, GraphicsFormat.R32_SFloat, 1, true);
// FSR2_LockInputLuma: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R16_FLOAT, FFX_RESOURCE_FLAGS_ALIASABLE
commandBuffer.GetTemporaryRT(Fsr2ShaderIDs.UavLockInputLuma, maxRenderSize.x, maxRenderSize.y, 0, default, GraphicsFormat.R16_SFloat, 1, true);
// FSR3UPSCALER_LockInputLuma: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R16_FLOAT, FFX_RESOURCE_FLAGS_ALIASABLE
commandBuffer.GetTemporaryRT(Fsr3ShaderIDs.UavLockInputLuma, maxRenderSize.x, maxRenderSize.y, 0, default, GraphicsFormat.R16_SFloat, 1, true);
// FSR2_DilatedReactiveMasks: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R8G8_UNORM, FFX_RESOURCE_FLAGS_ALIASABLE
commandBuffer.GetTemporaryRT(Fsr2ShaderIDs.UavDilatedReactiveMasks, maxRenderSize.x, maxRenderSize.y, 0, default, GraphicsFormat.R8G8_UNorm, 1, true);
// FSR3UPSCALER_DilatedReactiveMasks: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R8G8_UNORM, FFX_RESOURCE_FLAGS_ALIASABLE
commandBuffer.GetTemporaryRT(Fsr3ShaderIDs.UavDilatedReactiveMasks, maxRenderSize.x, maxRenderSize.y, 0, default, GraphicsFormat.R8G8_UNorm, 1, true);
// FSR2_PreparedInputColor: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R16G16B16A16_FLOAT, FFX_RESOURCE_FLAGS_ALIASABLE
commandBuffer.GetTemporaryRT(Fsr2ShaderIDs.UavPreparedInputColor, maxRenderSize.x, maxRenderSize.y, 0, default, GraphicsFormat.R16G16B16A16_SFloat, 1, true);
// FSR3UPSCALER_PreparedInputColor: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R16G16B16A16_FLOAT, FFX_RESOURCE_FLAGS_ALIASABLE
commandBuffer.GetTemporaryRT(Fsr3ShaderIDs.UavPreparedInputColor, maxRenderSize.x, maxRenderSize.y, 0, default, GraphicsFormat.R16G16B16A16_SFloat, 1, true);
// FSR2_NewLocks: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R8_UNORM, FFX_RESOURCE_FLAGS_ALIASABLE
commandBuffer.GetTemporaryRT(Fsr2ShaderIDs.UavNewLocks, displaySize.x, displaySize.y, 0, default, GraphicsFormat.R8_UNorm, 1, true);
// FSR3UPSCALER_NewLocks: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R8_UNORM, FFX_RESOURCE_FLAGS_ALIASABLE
commandBuffer.GetTemporaryRT(Fsr3ShaderIDs.UavNewLocks, displaySize.x, displaySize.y, 0, default, GraphicsFormat.R8_UNorm, 1, true);
}
public static void DestroyAliasableResources(CommandBuffer commandBuffer)
{
// Release all of the aliasable resources used this frame
commandBuffer.ReleaseTemporaryRT(Fsr2ShaderIDs.UavReconstructedPrevNearestDepth);
commandBuffer.ReleaseTemporaryRT(Fsr2ShaderIDs.UavDilatedDepth);
commandBuffer.ReleaseTemporaryRT(Fsr2ShaderIDs.UavLockInputLuma);
commandBuffer.ReleaseTemporaryRT(Fsr2ShaderIDs.UavDilatedReactiveMasks);
commandBuffer.ReleaseTemporaryRT(Fsr2ShaderIDs.UavPreparedInputColor);
commandBuffer.ReleaseTemporaryRT(Fsr2ShaderIDs.UavNewLocks);
commandBuffer.ReleaseTemporaryRT(Fsr3ShaderIDs.UavReconstructedPrevNearestDepth);
commandBuffer.ReleaseTemporaryRT(Fsr3ShaderIDs.UavDilatedDepth);
commandBuffer.ReleaseTemporaryRT(Fsr3ShaderIDs.UavLockInputLuma);
commandBuffer.ReleaseTemporaryRT(Fsr3ShaderIDs.UavDilatedReactiveMasks);
commandBuffer.ReleaseTemporaryRT(Fsr3ShaderIDs.UavPreparedInputColor);
commandBuffer.ReleaseTemporaryRT(Fsr3ShaderIDs.UavNewLocks);
}
private static void CreateDoubleBufferedResource(RenderTexture[] resource, string name, Vector2Int size, GraphicsFormat format)

3
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerResources.cs.meta

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: ec6c0c34c7b11f041885ddee4aa72818
timeCreated: 1677236102

2
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessLayer.cs

@ -97,7 +97,7 @@ namespace UnityEngine.Rendering.PostProcessing
public TemporalAntialiasing temporalAntialiasing;
/// <summary>
/// FSR2 upscaling & anti-aliasing settings for this camera.
/// FSR3 upscaling & anti-aliasing settings for this camera.
/// </summary>
public SuperResolution superResolution;

8
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/ffx_fsr2_lock_pass.compute.meta

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 3c96d72b39a840c428c901628dab92c0
ComputeShaderImporter:
externalObjects: {}
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

8
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/ffx_fsr2_rcas_pass.compute.meta

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 5a82801f160ff6a4eb47db567216e592
ComputeShaderImporter:
externalObjects: {}
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

8
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/ffx_fsr2_reconstruct_previous_depth_pass.compute.meta

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 6ef1b4c25874e334dad5ba3ac6345e32
ComputeShaderImporter:
externalObjects: {}
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

8
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/ffx_fsr2_tcr_autogen_pass.compute.meta

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: b478fba0a6a87b44b8be7c35deb5f0dc
ComputeShaderImporter:
externalObjects: {}
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

60
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_common_types.h.meta

@ -1,60 +0,0 @@
fileFormatVersion: 2
guid: c6da07d8aae05f04f87e4db20f84c73e
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude GameCoreScarlett: 1
Exclude GameCoreXboxOne: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude PS4: 1
Exclude PS5: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

60
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_core.h.meta

@ -1,60 +0,0 @@
fileFormatVersion: 2
guid: b37eb663a0ae01b469b0b5a54365b301
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude GameCoreScarlett: 1
Exclude GameCoreXboxOne: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude PS4: 1
Exclude PS5: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

60
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_core_cpu.h.meta

@ -1,60 +0,0 @@
fileFormatVersion: 2
guid: 9d1d6ed5c9da0c64b882f3ebc2bac307
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude GameCoreScarlett: 1
Exclude GameCoreXboxOne: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude PS4: 1
Exclude PS5: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

60
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_core_gpu_common.h.meta

@ -1,60 +0,0 @@
fileFormatVersion: 2
guid: 402c509393f5bf647b41a962a48ed8e2
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude GameCoreScarlett: 1
Exclude GameCoreXboxOne: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude PS4: 1
Exclude PS5: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

60
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_core_gpu_common_half.h.meta

@ -1,60 +0,0 @@
fileFormatVersion: 2
guid: 142bf3947ada43541a0f31a328fdec07
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude GameCoreScarlett: 1
Exclude GameCoreXboxOne: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude PS4: 1
Exclude PS5: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

60
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_core_hlsl.h.meta

@ -1,60 +0,0 @@
fileFormatVersion: 2
guid: 89d6e02f97594f64ca2da4c8124df6cf
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude GameCoreScarlett: 1
Exclude GameCoreXboxOne: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude PS4: 1
Exclude PS5: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

60
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_core_portability.h.meta

@ -1,60 +0,0 @@
fileFormatVersion: 2
guid: 5d6e692075988194382122bac7819f02
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude GameCoreScarlett: 1
Exclude GameCoreXboxOne: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude PS4: 1
Exclude PS5: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

60
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr1.h.meta

@ -1,60 +0,0 @@
fileFormatVersion: 2
guid: 7524e42f73f97f34bbeb414ea412a808
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude GameCoreScarlett: 1
Exclude GameCoreXboxOne: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude PS4: 1
Exclude PS5: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

60
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_accumulate.h.meta

@ -1,60 +0,0 @@
fileFormatVersion: 2
guid: a04cb2522aaff1045869a272ed129964
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude GameCoreScarlett: 1
Exclude GameCoreXboxOne: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude PS4: 1
Exclude PS5: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

78
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_accumulate_pass.hlsl

@ -1,78 +0,0 @@
// This file is part of the FidelityFX SDK.
//
// Copyright (c) 2022-2023 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.
#define FSR2_BIND_SRV_INPUT_EXPOSURE 0
#define FSR2_BIND_SRV_DILATED_REACTIVE_MASKS 1
#if FFX_FSR2_OPTION_LOW_RESOLUTION_MOTION_VECTORS
#define FSR2_BIND_SRV_DILATED_MOTION_VECTORS 2
#else
#define FSR2_BIND_SRV_INPUT_MOTION_VECTORS 2
#endif
#define FSR2_BIND_SRV_INTERNAL_UPSCALED 3
#define FSR2_BIND_SRV_LOCK_STATUS 4
#define FSR2_BIND_SRV_PREPARED_INPUT_COLOR 5
#define FSR2_BIND_SRV_LANCZOS_LUT 6
#define FSR2_BIND_SRV_UPSCALE_MAXIMUM_BIAS_LUT 7
#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_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_CB_FSR2 0
#include "ffx_fsr2_callbacks_hlsl.h"
#include "ffx_fsr2_common.h"
#include "ffx_fsr2_sample.h"
#include "ffx_fsr2_upsample.h"
#include "ffx_fsr2_postprocess_lock_status.h"
#include "ffx_fsr2_reproject.h"
#include "ffx_fsr2_accumulate.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 // 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_PREFER_WAVE64
FFX_FSR2_NUM_THREADS
FFX_FSR2_EMBED_ROOTSIG_CONTENT
void CS(uint2 uGroupId : SV_GroupID, uint2 uGroupThreadId : SV_GroupThreadID)
{
const uint GroupRows = (uint(DisplaySize().y) + FFX_FSR2_THREAD_GROUP_HEIGHT - 1) / FFX_FSR2_THREAD_GROUP_HEIGHT;
uGroupId.y = GroupRows - uGroupId.y - 1;
uint2 uDispatchThreadId = uGroupId * uint2(FFX_FSR2_THREAD_GROUP_WIDTH, FFX_FSR2_THREAD_GROUP_HEIGHT) + uGroupThreadId;
Accumulate(uDispatchThreadId);
}

85
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_autogen_reactive_pass.hlsl

@ -1,85 +0,0 @@
// This file is part of the FidelityFX SDK.
//
// Copyright (c) 2022-2023 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.
#define FSR2_BIND_SRV_INPUT_OPAQUE_ONLY 0
#define FSR2_BIND_SRV_INPUT_COLOR 1
#define FSR2_BIND_UAV_AUTOREACTIVE 0
#define FSR2_BIND_CB_FSR2 0
#define FSR2_BIND_CB_REACTIVE 1
#include "ffx_fsr2_callbacks_hlsl.h"
#include "ffx_fsr2_common.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 // 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
#if defined(FSR2_BIND_CB_REACTIVE)
cbuffer cbGenerateReactive : FFX_FSR2_DECLARE_CB(FSR2_BIND_CB_REACTIVE)
{
float scale;
float threshold;
float binaryValue;
uint flags;
};
#endif
FFX_FSR2_NUM_THREADS
FFX_FSR2_EMBED_ROOTSIG_CONTENT
void CS(uint2 uGroupId : SV_GroupID, uint2 uGroupThreadId : SV_GroupThreadID)
{
uint2 uDispatchThreadId = uGroupId * uint2(FFX_FSR2_THREAD_GROUP_WIDTH, FFX_FSR2_THREAD_GROUP_HEIGHT) + uGroupThreadId;
float3 ColorPreAlpha = LoadOpaqueOnly( FFX_MIN16_I2(uDispatchThreadId) ).rgb;
float3 ColorPostAlpha = LoadInputColor(uDispatchThreadId).rgb;
if (flags & FFX_FSR2_AUTOREACTIVEFLAGS_APPLY_TONEMAP)
{
ColorPreAlpha = Tonemap(ColorPreAlpha);
ColorPostAlpha = Tonemap(ColorPostAlpha);
}
if (flags & FFX_FSR2_AUTOREACTIVEFLAGS_APPLY_INVERSETONEMAP)
{
ColorPreAlpha = InverseTonemap(ColorPreAlpha);
ColorPostAlpha = InverseTonemap(ColorPostAlpha);
}
float out_reactive_value = 0.f;
float3 delta = abs(ColorPostAlpha - ColorPreAlpha);
out_reactive_value = (flags & FFX_FSR2_AUTOREACTIVEFLAGS_USE_COMPONENTS_MAX) ? max(delta.x, max(delta.y, delta.z)) : length(delta);
out_reactive_value *= scale;
out_reactive_value = (flags & FFX_FSR2_AUTOREACTIVEFLAGS_APPLY_THRESHOLD) ? (out_reactive_value < threshold ? 0 : binaryValue) : out_reactive_value;
rw_output_autoreactive[uDispatchThreadId] = out_reactive_value;
}

817
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_callbacks_hlsl.h

@ -1,817 +0,0 @@
// This file is part of the FidelityFX SDK.
//
// Copyright (c) 2022-2023 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.
#include "ffx_fsr2_resources.h"
#if defined(FFX_GPU)
#ifdef __hlsl_dx_compiler
#pragma dxc diagnostic push
#pragma dxc diagnostic ignored "-Wambig-lit-shift"
#endif //__hlsl_dx_compiler
#include "ffx_core.h"
#ifdef __hlsl_dx_compiler
#pragma dxc diagnostic pop
#endif //__hlsl_dx_compiler
#endif // #if defined(FFX_GPU)
#if defined(FFX_GPU)
#ifndef FFX_FSR2_PREFER_WAVE64
#define FFX_FSR2_PREFER_WAVE64
#endif // #if defined(FFX_GPU)
#if defined(FFX_GPU)
#pragma warning(disable: 3205) // conversion from larger type to smaller
#endif // #if defined(FFX_GPU)
#define DECLARE_SRV_REGISTER(regIndex) t##regIndex
#define DECLARE_UAV_REGISTER(regIndex) u##regIndex
#define DECLARE_CB_REGISTER(regIndex) b##regIndex
#define FFX_FSR2_DECLARE_SRV(regIndex) register(DECLARE_SRV_REGISTER(regIndex))
#define FFX_FSR2_DECLARE_UAV(regIndex) register(DECLARE_UAV_REGISTER(regIndex))
#define FFX_FSR2_DECLARE_CB(regIndex) register(DECLARE_CB_REGISTER(regIndex))
#if defined(FSR2_BIND_CB_FSR2) || defined(FFX_INTERNAL)
cbuffer cbFSR2 : FFX_FSR2_DECLARE_CB(FSR2_BIND_CB_FSR2)
{
FfxInt32x2 iRenderSize;
FfxInt32x2 iMaxRenderSize;
FfxInt32x2 iDisplaySize;
FfxInt32x2 iInputColorResourceDimensions;
FfxInt32x2 iLumaMipDimensions;
FfxInt32 iLumaMipLevelToUse;
FfxInt32 iFrameIndex;
FfxFloat32x4 fDeviceToViewDepth;
FfxFloat32x2 fJitter;
FfxFloat32x2 fMotionVectorScale;
FfxFloat32x2 fDownscaleFactor;
FfxFloat32x2 fMotionVectorJitterCancellation;
FfxFloat32 fPreExposure;
FfxFloat32 fPreviousFramePreExposure;
FfxFloat32 fTanHalfFOV;
FfxFloat32 fJitterSequenceLength;
FfxFloat32 fDeltaTime;
FfxFloat32 fDynamicResChangeFactor;
FfxFloat32 fViewSpaceToMetersFactor;
FfxInt32 iDummy;
};
#define FFX_FSR2_CONSTANT_BUFFER_1_SIZE (sizeof(cbFSR2) / 4) // Number of 32-bit values. This must be kept in sync with the cbFSR2 size.
#endif
#if defined(FFX_GPU)
#define FFX_FSR2_ROOTSIG_STRINGIFY(p) FFX_FSR2_ROOTSIG_STR(p)
#define FFX_FSR2_ROOTSIG_STR(p) #p
#define FFX_FSR2_ROOTSIG [RootSignature( "DescriptorTable(UAV(u0, numDescriptors = " FFX_FSR2_ROOTSIG_STRINGIFY(FFX_FSR2_RESOURCE_IDENTIFIER_COUNT) ")), " \
"DescriptorTable(SRV(t0, numDescriptors = " FFX_FSR2_ROOTSIG_STRINGIFY(FFX_FSR2_RESOURCE_IDENTIFIER_COUNT) ")), " \
"RootConstants(num32BitConstants=" FFX_FSR2_ROOTSIG_STRINGIFY(FFX_FSR2_CONSTANT_BUFFER_1_SIZE) ", b0), " \
"StaticSampler(s0, filter = FILTER_MIN_MAG_MIP_POINT, " \
"addressU = TEXTURE_ADDRESS_CLAMP, " \
"addressV = TEXTURE_ADDRESS_CLAMP, " \
"addressW = TEXTURE_ADDRESS_CLAMP, " \
"comparisonFunc = COMPARISON_NEVER, " \
"borderColor = STATIC_BORDER_COLOR_TRANSPARENT_BLACK), " \
"StaticSampler(s1, filter = FILTER_MIN_MAG_MIP_LINEAR, " \
"addressU = TEXTURE_ADDRESS_CLAMP, " \
"addressV = TEXTURE_ADDRESS_CLAMP, " \
"addressW = TEXTURE_ADDRESS_CLAMP, " \
"comparisonFunc = COMPARISON_NEVER, " \
"borderColor = STATIC_BORDER_COLOR_TRANSPARENT_BLACK)" )]
#define FFX_FSR2_CONSTANT_BUFFER_2_SIZE 6 // Number of 32-bit values. This must be kept in sync with max( cbRCAS , cbSPD) size.
#define FFX_FSR2_CB2_ROOTSIG [RootSignature( "DescriptorTable(UAV(u0, numDescriptors = " FFX_FSR2_ROOTSIG_STRINGIFY(FFX_FSR2_RESOURCE_IDENTIFIER_COUNT) ")), " \
"DescriptorTable(SRV(t0, numDescriptors = " FFX_FSR2_ROOTSIG_STRINGIFY(FFX_FSR2_RESOURCE_IDENTIFIER_COUNT) ")), " \
"RootConstants(num32BitConstants=" FFX_FSR2_ROOTSIG_STRINGIFY(FFX_FSR2_CONSTANT_BUFFER_1_SIZE) ", b0), " \
"RootConstants(num32BitConstants=" FFX_FSR2_ROOTSIG_STRINGIFY(FFX_FSR2_CONSTANT_BUFFER_2_SIZE) ", b1), " \
"StaticSampler(s0, filter = FILTER_MIN_MAG_MIP_POINT, " \
"addressU = TEXTURE_ADDRESS_CLAMP, " \
"addressV = TEXTURE_ADDRESS_CLAMP, " \
"addressW = TEXTURE_ADDRESS_CLAMP, " \
"comparisonFunc = COMPARISON_NEVER, " \
"borderColor = STATIC_BORDER_COLOR_TRANSPARENT_BLACK), " \
"StaticSampler(s1, filter = FILTER_MIN_MAG_MIP_LINEAR, " \
"addressU = TEXTURE_ADDRESS_CLAMP, " \
"addressV = TEXTURE_ADDRESS_CLAMP, " \
"addressW = TEXTURE_ADDRESS_CLAMP, " \
"comparisonFunc = COMPARISON_NEVER, " \
"borderColor = STATIC_BORDER_COLOR_TRANSPARENT_BLACK)" )]
#if defined(FFX_FSR2_EMBED_ROOTSIG)
#define FFX_FSR2_EMBED_ROOTSIG_CONTENT FFX_FSR2_ROOTSIG
#define FFX_FSR2_EMBED_CB2_ROOTSIG_CONTENT FFX_FSR2_CB2_ROOTSIG
#else
#define FFX_FSR2_EMBED_ROOTSIG_CONTENT
#define FFX_FSR2_EMBED_CB2_ROOTSIG_CONTENT
#endif // #if FFX_FSR2_EMBED_ROOTSIG
#endif // #if defined(FFX_GPU)
// Declare and sample camera buffers as regular textures, unless overridden
#if !defined(UNITY_FSR2_TEX2D)
#define UNITY_FSR2_TEX2D(type) Texture2D<type>
#endif
#if !defined(UNITY_FSR2_POS)
#define UNITY_FSR2_POS(pxPos) (pxPos)
#endif
#if !defined(UNITY_FSR2_UV)
#define UNITY_FSR2_UV(uv) (uv)
#endif
/* Define getter functions in the order they are defined in the CB! */
FfxInt32x2 RenderSize()
{
return iRenderSize;
}
FfxInt32x2 MaxRenderSize()
{
return iMaxRenderSize;
}
FfxInt32x2 DisplaySize()
{
return iDisplaySize;
}
FfxInt32x2 InputColorResourceDimensions()
{
return iInputColorResourceDimensions;
}
FfxInt32x2 LumaMipDimensions()
{
return iLumaMipDimensions;
}
FfxInt32 LumaMipLevelToUse()
{
return iLumaMipLevelToUse;
}
FfxInt32 FrameIndex()
{
return iFrameIndex;
}
FfxFloat32x2 Jitter()
{
return fJitter;
}
FfxFloat32x4 DeviceToViewSpaceTransformFactors()
{
return fDeviceToViewDepth;
}
FfxFloat32x2 MotionVectorScale()
{
return fMotionVectorScale;
}
FfxFloat32x2 DownscaleFactor()
{
return fDownscaleFactor;
}
FfxFloat32x2 MotionVectorJitterCancellation()
{
return fMotionVectorJitterCancellation;
}
FfxFloat32 PreExposure()
{
return fPreExposure;
}
FfxFloat32 PreviousFramePreExposure()
{
return fPreviousFramePreExposure;
}
FfxFloat32 TanHalfFoV()
{
return fTanHalfFOV;
}
FfxFloat32 JitterSequenceLength()
{
return fJitterSequenceLength;
}
FfxFloat32 DeltaTime()
{
return fDeltaTime;
}
FfxFloat32 DynamicResChangeFactor()
{
return fDynamicResChangeFactor;
}
FfxFloat32 ViewSpaceToMetersFactor()
{
return fViewSpaceToMetersFactor;
}
SamplerState s_PointClamp : register(s0);
SamplerState s_LinearClamp : register(s1);
// SRVs
#if defined(FFX_INTERNAL)
UNITY_FSR2_TEX2D(FfxFloat32x4) r_input_opaque_only : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_INPUT_OPAQUE_ONLY);
UNITY_FSR2_TEX2D(FfxFloat32x4) r_input_color_jittered : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_INPUT_COLOR);
UNITY_FSR2_TEX2D(FfxFloat32x4) r_input_motion_vectors : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_INPUT_MOTION_VECTORS);
UNITY_FSR2_TEX2D(FfxFloat32) r_input_depth : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_INPUT_DEPTH);
Texture2D<FfxFloat32x2> r_input_exposure : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_INPUT_EXPOSURE);
Texture2D<FfxFloat32x2> r_auto_exposure : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_AUTO_EXPOSURE);
Texture2D<FfxFloat32> r_reactive_mask : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_INPUT_REACTIVE_MASK);
Texture2D<FfxFloat32> r_transparency_and_composition_mask : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_INPUT_TRANSPARENCY_AND_COMPOSITION_MASK);
Texture2D<FfxUInt32> r_reconstructed_previous_nearest_depth : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_RECONSTRUCTED_PREVIOUS_NEAREST_DEPTH);
Texture2D<FfxFloat32x2> r_dilated_motion_vectors : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_DILATED_MOTION_VECTORS);
Texture2D<FfxFloat32x2> r_previous_dilated_motion_vectors : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_PREVIOUS_DILATED_MOTION_VECTORS);
Texture2D<FfxFloat32> r_dilatedDepth : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_DILATED_DEPTH);
Texture2D<FfxFloat32x4> r_internal_upscaled_color : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_INTERNAL_UPSCALED_COLOR);
Texture2D<unorm FfxFloat32x2> r_lock_status : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_LOCK_STATUS);
Texture2D<FfxFloat32> r_lock_input_luma : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_LOCK_INPUT_LUMA);
Texture2D<unorm FfxFloat32> r_new_locks : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_NEW_LOCKS);
Texture2D<FfxFloat32x4> r_prepared_input_color : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_PREPARED_INPUT_COLOR);
Texture2D<FfxFloat32x4> r_luma_history : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_LUMA_HISTORY);
Texture2D<FfxFloat32x4> r_rcas_input : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_RCAS_INPUT);
Texture2D<FfxFloat32> r_lanczos_lut : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_LANCZOS_LUT);
Texture2D<FfxFloat32> r_imgMips : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_SCENE_LUMINANCE);
Texture2D<FfxFloat32> r_upsample_maximum_bias_lut : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTITIER_UPSAMPLE_MAXIMUM_BIAS_LUT);
Texture2D<unorm FfxFloat32x2> r_dilated_reactive_masks : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_DILATED_REACTIVE_MASKS);
Texture2D<float3> r_input_prev_color_pre_alpha : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_PREV_PRE_ALPHA_COLOR);
Texture2D<float3> r_input_prev_color_post_alpha : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_PREV_POST_ALPHA_COLOR);
Texture2D<FfxFloat32x4> r_debug_out : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_DEBUG_OUTPUT);
// UAV declarations
RWTexture2D<FfxUInt32> rw_reconstructed_previous_nearest_depth : FFX_FSR2_DECLARE_UAV(FFX_FSR2_RESOURCE_IDENTIFIER_RECONSTRUCTED_PREVIOUS_NEAREST_DEPTH);
RWTexture2D<FfxFloat32x2> rw_dilated_motion_vectors : FFX_FSR2_DECLARE_UAV(FFX_FSR2_RESOURCE_IDENTIFIER_DILATED_MOTION_VECTORS);
RWTexture2D<FfxFloat32> rw_dilatedDepth : FFX_FSR2_DECLARE_UAV(FFX_FSR2_RESOURCE_IDENTIFIER_DILATED_DEPTH);
RWTexture2D<FfxFloat32x4> rw_internal_upscaled_color : FFX_FSR2_DECLARE_UAV(FFX_FSR2_RESOURCE_IDENTIFIER_INTERNAL_UPSCALED_COLOR);
RWTexture2D<unorm FfxFloat32x2> rw_lock_status : FFX_FSR2_DECLARE_UAV(FFX_FSR2_RESOURCE_IDENTIFIER_LOCK_STATUS);
RWTexture2D<FfxFloat32> rw_lock_input_luma : FFX_FSR2_DECLARE_UAV(FFX_FSR2_RESOURCE_IDENTIFIER_LOCK_INPUT_LUMA);
RWTexture2D<unorm FfxFloat32> rw_new_locks : FFX_FSR2_DECLARE_UAV(FFX_FSR2_RESOURCE_IDENTIFIER_NEW_LOCKS);
RWTexture2D<FfxFloat32x4> rw_prepared_input_color : FFX_FSR2_DECLARE_UAV(FFX_FSR2_RESOURCE_IDENTIFIER_PREPARED_INPUT_COLOR);
RWTexture2D<FfxFloat32x4> rw_luma_history : FFX_FSR2_DECLARE_UAV(FFX_FSR2_RESOURCE_IDENTIFIER_LUMA_HISTORY);
RWTexture2D<FfxFloat32x4> rw_upscaled_output : FFX_FSR2_DECLARE_UAV(FFX_FSR2_RESOURCE_IDENTIFIER_UPSCALED_OUTPUT);
globallycoherent RWTexture2D<FfxFloat32> rw_img_mip_shading_change : FFX_FSR2_DECLARE_UAV(FFX_FSR2_RESOURCE_IDENTIFIER_SCENE_LUMINANCE_MIPMAP_SHADING_CHANGE);
globallycoherent RWTexture2D<FfxFloat32> rw_img_mip_5 : FFX_FSR2_DECLARE_UAV(FFX_FSR2_RESOURCE_IDENTIFIER_SCENE_LUMINANCE_MIPMAP_5);
RWTexture2D<unorm FfxFloat32x2> rw_dilated_reactive_masks : FFX_FSR2_DECLARE_UAV(FFX_FSR2_RESOURCE_IDENTIFIER_DILATED_REACTIVE_MASKS);
RWTexture2D<FfxFloat32x2> rw_auto_exposure : FFX_FSR2_DECLARE_UAV(FFX_FSR2_RESOURCE_IDENTIFIER_AUTO_EXPOSURE);
globallycoherent RWTexture2D<FfxUInt32> rw_spd_global_atomic : FFX_FSR2_DECLARE_UAV(FFX_FSR2_RESOURCE_IDENTIFIER_SPD_ATOMIC_COUNT);
RWTexture2D<FfxFloat32x4> rw_debug_out : FFX_FSR2_DECLARE_UAV(FFX_FSR2_RESOURCE_IDENTIFIER_DEBUG_OUTPUT);
RWTexture2D<float> rw_output_autoreactive : FFX_FSR2_DECLARE_UAV(FFX_FSR2_RESOURCE_IDENTIFIER_AUTOREACTIVE);
RWTexture2D<float> rw_output_autocomposition : FFX_FSR2_DECLARE_UAV(FFX_FSR2_RESOURCE_IDENTIFIER_AUTOCOMPOSITION);
RWTexture2D<float3> rw_output_prev_color_pre_alpha : FFX_FSR2_DECLARE_UAV(FFX_FSR2_RESOURCE_IDENTIFIER_PREV_PRE_ALPHA_COLOR);
RWTexture2D<float3> rw_output_prev_color_post_alpha : FFX_FSR2_DECLARE_UAV(FFX_FSR2_RESOURCE_IDENTIFIER_PREV_POST_ALPHA_COLOR);
#else // #if defined(FFX_INTERNAL)
#if defined FSR2_BIND_SRV_INPUT_COLOR
UNITY_FSR2_TEX2D(FfxFloat32x4) r_input_color_jittered : FFX_FSR2_DECLARE_SRV(FSR2_BIND_SRV_INPUT_COLOR);
#endif
#if defined FSR2_BIND_SRV_INPUT_OPAQUE_ONLY
UNITY_FSR2_TEX2D(FfxFloat32x4) r_input_opaque_only : FFX_FSR2_DECLARE_SRV(FSR2_BIND_SRV_INPUT_OPAQUE_ONLY);
#endif
#if defined FSR2_BIND_SRV_INPUT_MOTION_VECTORS
UNITY_FSR2_TEX2D(FfxFloat32x4) r_input_motion_vectors : FFX_FSR2_DECLARE_SRV(FSR2_BIND_SRV_INPUT_MOTION_VECTORS);
#endif
#if defined FSR2_BIND_SRV_INPUT_DEPTH
UNITY_FSR2_TEX2D(FfxFloat32) r_input_depth : FFX_FSR2_DECLARE_SRV(FSR2_BIND_SRV_INPUT_DEPTH);
#endif
#if defined FSR2_BIND_SRV_INPUT_EXPOSURE
Texture2D<FfxFloat32x2> r_input_exposure : FFX_FSR2_DECLARE_SRV(FSR2_BIND_SRV_INPUT_EXPOSURE);
#endif
#if defined FSR2_BIND_SRV_AUTO_EXPOSURE
Texture2D<FfxFloat32x2> r_auto_exposure : FFX_FSR2_DECLARE_SRV(FSR2_BIND_SRV_AUTO_EXPOSURE);
#endif
#if defined FSR2_BIND_SRV_REACTIVE_MASK
Texture2D<FfxFloat32> r_reactive_mask : FFX_FSR2_DECLARE_SRV(FSR2_BIND_SRV_REACTIVE_MASK);
#endif
#if defined FSR2_BIND_SRV_TRANSPARENCY_AND_COMPOSITION_MASK
Texture2D<FfxFloat32> r_transparency_and_composition_mask : FFX_FSR2_DECLARE_SRV(FSR2_BIND_SRV_TRANSPARENCY_AND_COMPOSITION_MASK);
#endif
#if defined FSR2_BIND_SRV_RECONSTRUCTED_PREV_NEAREST_DEPTH
Texture2D<FfxUInt32> r_reconstructed_previous_nearest_depth : FFX_FSR2_DECLARE_SRV(FSR2_BIND_SRV_RECONSTRUCTED_PREV_NEAREST_DEPTH);
#endif
#if defined FSR2_BIND_SRV_DILATED_MOTION_VECTORS
Texture2D<FfxFloat32x2> r_dilated_motion_vectors : FFX_FSR2_DECLARE_SRV(FSR2_BIND_SRV_DILATED_MOTION_VECTORS);
#endif
#if defined FSR2_BIND_SRV_PREVIOUS_DILATED_MOTION_VECTORS
Texture2D<FfxFloat32x2> r_previous_dilated_motion_vectors : FFX_FSR2_DECLARE_SRV(FSR2_BIND_SRV_PREVIOUS_DILATED_MOTION_VECTORS);
#endif
#if defined FSR2_BIND_SRV_DILATED_DEPTH
Texture2D<FfxFloat32> r_dilatedDepth : FFX_FSR2_DECLARE_SRV(FSR2_BIND_SRV_DILATED_DEPTH);
#endif
#if defined FSR2_BIND_SRV_INTERNAL_UPSCALED
Texture2D<FfxFloat32x4> r_internal_upscaled_color : FFX_FSR2_DECLARE_SRV(FSR2_BIND_SRV_INTERNAL_UPSCALED);
#endif
#if defined FSR2_BIND_SRV_LOCK_STATUS
Texture2D<unorm FfxFloat32x2> r_lock_status : FFX_FSR2_DECLARE_SRV(FSR2_BIND_SRV_LOCK_STATUS);
#endif
#if defined FSR2_BIND_SRV_LOCK_INPUT_LUMA
Texture2D<FfxFloat32> r_lock_input_luma : FFX_FSR2_DECLARE_SRV(FSR2_BIND_SRV_LOCK_INPUT_LUMA);
#endif
#if defined FSR2_BIND_SRV_NEW_LOCKS
Texture2D<unorm FfxFloat32> r_new_locks : FFX_FSR2_DECLARE_SRV(FSR2_BIND_SRV_NEW_LOCKS);
#endif
#if defined FSR2_BIND_SRV_PREPARED_INPUT_COLOR
Texture2D<FfxFloat32x4> r_prepared_input_color : FFX_FSR2_DECLARE_SRV(FSR2_BIND_SRV_PREPARED_INPUT_COLOR);
#endif
#if defined FSR2_BIND_SRV_LUMA_HISTORY
Texture2D<unorm FfxFloat32x4> r_luma_history : FFX_FSR2_DECLARE_SRV(FSR2_BIND_SRV_LUMA_HISTORY);
#endif
#if defined FSR2_BIND_SRV_RCAS_INPUT
Texture2D<FfxFloat32x4> r_rcas_input : FFX_FSR2_DECLARE_SRV(FSR2_BIND_SRV_RCAS_INPUT);
#endif
#if defined FSR2_BIND_SRV_LANCZOS_LUT
Texture2D<FfxFloat32> r_lanczos_lut : FFX_FSR2_DECLARE_SRV(FSR2_BIND_SRV_LANCZOS_LUT);
#endif
#if defined FSR2_BIND_SRV_SCENE_LUMINANCE_MIPS
Texture2D<FfxFloat32> r_imgMips : FFX_FSR2_DECLARE_SRV(FSR2_BIND_SRV_SCENE_LUMINANCE_MIPS);
#endif
#if defined FSR2_BIND_SRV_UPSCALE_MAXIMUM_BIAS_LUT
Texture2D<FfxFloat32> r_upsample_maximum_bias_lut : FFX_FSR2_DECLARE_SRV(FSR2_BIND_SRV_UPSCALE_MAXIMUM_BIAS_LUT);
#endif
#if defined FSR2_BIND_SRV_DILATED_REACTIVE_MASKS
Texture2D<unorm FfxFloat32x2> r_dilated_reactive_masks : FFX_FSR2_DECLARE_SRV(FSR2_BIND_SRV_DILATED_REACTIVE_MASKS);
#endif
#if defined FSR2_BIND_SRV_PREV_PRE_ALPHA_COLOR
Texture2D<float3> r_input_prev_color_pre_alpha : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_PREV_PRE_ALPHA_COLOR);
#endif
#if defined FSR2_BIND_SRV_PREV_POST_ALPHA_COLOR
Texture2D<float3> r_input_prev_color_post_alpha : FFX_FSR2_DECLARE_SRV(FFX_FSR2_RESOURCE_IDENTIFIER_PREV_POST_ALPHA_COLOR);
#endif
// UAV declarations
#if defined FSR2_BIND_UAV_RECONSTRUCTED_PREV_NEAREST_DEPTH
RWTexture2D<FfxUInt32> rw_reconstructed_previous_nearest_depth : FFX_FSR2_DECLARE_UAV(FSR2_BIND_UAV_RECONSTRUCTED_PREV_NEAREST_DEPTH);
#endif
#if defined FSR2_BIND_UAV_DILATED_MOTION_VECTORS
RWTexture2D<FfxFloat32x2> rw_dilated_motion_vectors : FFX_FSR2_DECLARE_UAV(FSR2_BIND_UAV_DILATED_MOTION_VECTORS);
#endif
#if defined FSR2_BIND_UAV_DILATED_DEPTH
RWTexture2D<FfxFloat32> rw_dilatedDepth : FFX_FSR2_DECLARE_UAV(FSR2_BIND_UAV_DILATED_DEPTH);
#endif
#if defined FSR2_BIND_UAV_INTERNAL_UPSCALED
RWTexture2D<FfxFloat32x4> rw_internal_upscaled_color : FFX_FSR2_DECLARE_UAV(FSR2_BIND_UAV_INTERNAL_UPSCALED);
#endif
#if defined FSR2_BIND_UAV_LOCK_STATUS
RWTexture2D<unorm FfxFloat32x2> rw_lock_status : FFX_FSR2_DECLARE_UAV(FSR2_BIND_UAV_LOCK_STATUS);
#endif
#if defined FSR2_BIND_UAV_LOCK_INPUT_LUMA
RWTexture2D<FfxFloat32> rw_lock_input_luma : FFX_FSR2_DECLARE_UAV(FSR2_BIND_UAV_LOCK_INPUT_LUMA);
#endif
#if defined FSR2_BIND_UAV_NEW_LOCKS
RWTexture2D<unorm FfxFloat32> rw_new_locks : FFX_FSR2_DECLARE_UAV(FSR2_BIND_UAV_NEW_LOCKS);
#endif
#if defined FSR2_BIND_UAV_PREPARED_INPUT_COLOR
RWTexture2D<FfxFloat32x4> rw_prepared_input_color : FFX_FSR2_DECLARE_UAV(FSR2_BIND_UAV_PREPARED_INPUT_COLOR);
#endif
#if defined FSR2_BIND_UAV_LUMA_HISTORY
RWTexture2D<FfxFloat32x4> rw_luma_history : FFX_FSR2_DECLARE_UAV(FSR2_BIND_UAV_LUMA_HISTORY);
#endif
#if defined FSR2_BIND_UAV_UPSCALED_OUTPUT
RWTexture2D<FfxFloat32x4> rw_upscaled_output : FFX_FSR2_DECLARE_UAV(FSR2_BIND_UAV_UPSCALED_OUTPUT);
#endif
#if defined FSR2_BIND_UAV_EXPOSURE_MIP_LUMA_CHANGE
globallycoherent RWTexture2D<FfxFloat32> rw_img_mip_shading_change : FFX_FSR2_DECLARE_UAV(FSR2_BIND_UAV_EXPOSURE_MIP_LUMA_CHANGE);
#endif
#if defined FSR2_BIND_UAV_EXPOSURE_MIP_5
globallycoherent RWTexture2D<FfxFloat32> rw_img_mip_5 : FFX_FSR2_DECLARE_UAV(FSR2_BIND_UAV_EXPOSURE_MIP_5);
#endif
#if defined FSR2_BIND_UAV_DILATED_REACTIVE_MASKS
RWTexture2D<unorm FfxFloat32x2> rw_dilated_reactive_masks : FFX_FSR2_DECLARE_UAV(FSR2_BIND_UAV_DILATED_REACTIVE_MASKS);
#endif
#if defined FSR2_BIND_UAV_EXPOSURE
RWTexture2D<FfxFloat32x2> rw_exposure : FFX_FSR2_DECLARE_UAV(FSR2_BIND_UAV_EXPOSURE);
#endif
#if defined FSR2_BIND_UAV_AUTO_EXPOSURE
RWTexture2D<FfxFloat32x2> rw_auto_exposure : FFX_FSR2_DECLARE_UAV(FSR2_BIND_UAV_AUTO_EXPOSURE);
#endif
#if defined FSR2_BIND_UAV_SPD_GLOBAL_ATOMIC
globallycoherent RWTexture2D<FfxUInt32> rw_spd_global_atomic : FFX_FSR2_DECLARE_UAV(FSR2_BIND_UAV_SPD_GLOBAL_ATOMIC);
#endif
#if defined FSR2_BIND_UAV_AUTOREACTIVE
RWTexture2D<float> rw_output_autoreactive : FFX_FSR2_DECLARE_UAV(FSR2_BIND_UAV_AUTOREACTIVE);
#endif
#if defined FSR2_BIND_UAV_AUTOCOMPOSITION
RWTexture2D<float> rw_output_autocomposition : FFX_FSR2_DECLARE_UAV(FSR2_BIND_UAV_AUTOCOMPOSITION);
#endif
#if defined FSR2_BIND_UAV_PREV_PRE_ALPHA_COLOR
RWTexture2D<float3> rw_output_prev_color_pre_alpha : FFX_FSR2_DECLARE_UAV(FSR2_BIND_UAV_PREV_PRE_ALPHA_COLOR);
#endif
#if defined FSR2_BIND_UAV_PREV_POST_ALPHA_COLOR
RWTexture2D<float3> rw_output_prev_color_post_alpha : FFX_FSR2_DECLARE_UAV(FSR2_BIND_UAV_PREV_POST_ALPHA_COLOR);
#endif
#endif // #if defined(FFX_INTERNAL)
#if defined(FSR2_BIND_SRV_SCENE_LUMINANCE_MIPS) || defined(FFX_INTERNAL)
FfxFloat32 LoadMipLuma(FfxUInt32x2 iPxPos, FfxUInt32 mipLevel)
{
return r_imgMips.mips[mipLevel][iPxPos];
}
#endif
#if defined(FSR2_BIND_SRV_SCENE_LUMINANCE_MIPS) || defined(FFX_INTERNAL)
FfxFloat32 SampleMipLuma(FfxFloat32x2 fUV, FfxUInt32 mipLevel)
{
return r_imgMips.SampleLevel(s_LinearClamp, fUV, mipLevel);
}
#endif
#if defined(FSR2_BIND_SRV_INPUT_DEPTH) || defined(FFX_INTERNAL)
FfxFloat32 LoadInputDepth(FfxUInt32x2 iPxPos)
{
return r_input_depth[UNITY_FSR2_POS(iPxPos)];
}
#endif
#if defined(FSR2_BIND_SRV_INPUT_DEPTH) || defined(FFX_INTERNAL)
FfxFloat32 SampleInputDepth(FfxFloat32x2 fUV)
{
return r_input_depth.SampleLevel(s_LinearClamp, UNITY_FSR2_UV(fUV), 0).x;
}
#endif
#if defined(FSR2_BIND_SRV_REACTIVE_MASK) || defined(FFX_INTERNAL)
FfxFloat32 LoadReactiveMask(FfxUInt32x2 iPxPos)
{
return r_reactive_mask[iPxPos];
}
#endif
#if defined(FSR2_BIND_SRV_TRANSPARENCY_AND_COMPOSITION_MASK) || defined(FFX_INTERNAL)
FfxFloat32 LoadTransparencyAndCompositionMask(FfxUInt32x2 iPxPos)
{
return r_transparency_and_composition_mask[iPxPos];
}
#endif
#if defined(FSR2_BIND_SRV_INPUT_COLOR) || defined(FFX_INTERNAL)
FfxFloat32x3 LoadInputColor(FfxUInt32x2 iPxPos)
{
return r_input_color_jittered[UNITY_FSR2_POS(iPxPos)].rgb;
}
#endif
#if defined(FSR2_BIND_SRV_INPUT_COLOR) || defined(FFX_INTERNAL)
FfxFloat32x3 SampleInputColor(FfxFloat32x2 fUV)
{
return r_input_color_jittered.SampleLevel(s_LinearClamp, UNITY_FSR2_UV(fUV), 0).rgb;
}
#endif
#if defined(FSR2_BIND_SRV_PREPARED_INPUT_COLOR) || defined(FFX_INTERNAL)
FfxFloat32x3 LoadPreparedInputColor(FfxUInt32x2 iPxPos)
{
return r_prepared_input_color[iPxPos].xyz;
}
#endif
#if defined(FSR2_BIND_SRV_INPUT_MOTION_VECTORS) || defined(FFX_INTERNAL)
FfxFloat32x2 LoadInputMotionVector(FfxUInt32x2 iPxDilatedMotionVectorPos)
{
FfxFloat32x2 fSrcMotionVector = r_input_motion_vectors[UNITY_FSR2_POS(iPxDilatedMotionVectorPos)].xy;
FfxFloat32x2 fUvMotionVector = fSrcMotionVector * MotionVectorScale();
#if FFX_FSR2_OPTION_JITTERED_MOTION_VECTORS
fUvMotionVector -= MotionVectorJitterCancellation();
#endif
return fUvMotionVector;
}
#endif
#if defined(FSR2_BIND_SRV_INTERNAL_UPSCALED) || defined(FFX_INTERNAL)
FfxFloat32x4 LoadHistory(FfxUInt32x2 iPxHistory)
{
return r_internal_upscaled_color[iPxHistory];
}
#endif
#if defined(FSR2_BIND_UAV_LUMA_HISTORY) || defined(FFX_INTERNAL)
void StoreLumaHistory(FfxUInt32x2 iPxPos, FfxFloat32x4 fLumaHistory)
{
rw_luma_history[iPxPos] = fLumaHistory;
}
FfxFloat32x4 LoadRwLumaHistory(FFX_MIN16_I2 iPxPos)
{
return rw_luma_history[iPxPos];
}
#endif
#if defined(FSR2_BIND_SRV_LUMA_HISTORY) || defined(FFX_INTERNAL)
FfxFloat32x4 SampleLumaHistory(FfxFloat32x2 fUV)
{
return r_luma_history.SampleLevel(s_LinearClamp, fUV, 0);
}
#endif
#if defined(FFX_INTERNAL)
FfxFloat32x4 SampleDebug(FfxFloat32x2 fUV)
{
return r_debug_out.SampleLevel(s_LinearClamp, fUV, 0).w;
}
#endif
#if defined(FSR2_BIND_UAV_INTERNAL_UPSCALED) || defined(FFX_INTERNAL)
void StoreReprojectedHistory(FfxUInt32x2 iPxHistory, FfxFloat32x4 fHistory)
{
rw_internal_upscaled_color[iPxHistory] = fHistory;
}
#endif
#if defined(FSR2_BIND_UAV_INTERNAL_UPSCALED) || defined(FFX_INTERNAL)
void StoreInternalColorAndWeight(FfxUInt32x2 iPxPos, FfxFloat32x4 fColorAndWeight)
{
rw_internal_upscaled_color[iPxPos] = fColorAndWeight;
}
#endif
#if defined(FSR2_BIND_UAV_UPSCALED_OUTPUT) || defined(FFX_INTERNAL)
void StoreUpscaledOutput(FfxUInt32x2 iPxPos, FfxFloat32x3 fColor)
{
rw_upscaled_output[iPxPos] = FfxFloat32x4(fColor, 1.f);
}
#endif
//LOCK_LIFETIME_REMAINING == 0
//Should make LockInitialLifetime() return a const 1.0f later
#if defined(FSR2_BIND_SRV_LOCK_STATUS) || defined(FFX_INTERNAL)
FfxFloat32x2 LoadLockStatus(FfxUInt32x2 iPxPos)
{
return r_lock_status[iPxPos];
}
#endif
#if defined(FSR2_BIND_UAV_LOCK_STATUS) || defined(FFX_INTERNAL)
void StoreLockStatus(FfxUInt32x2 iPxPos, FfxFloat32x2 fLockStatus)
{
rw_lock_status[iPxPos] = fLockStatus;
}
#endif
#if defined(FSR2_BIND_SRV_LOCK_INPUT_LUMA) || defined(FFX_INTERNAL)
FfxFloat32 LoadLockInputLuma(FfxUInt32x2 iPxPos)
{
return r_lock_input_luma[iPxPos];
}
#endif
#if defined(FSR2_BIND_UAV_LOCK_INPUT_LUMA) || defined(FFX_INTERNAL)
void StoreLockInputLuma(FfxUInt32x2 iPxPos, FfxFloat32 fLuma)
{
rw_lock_input_luma[iPxPos] = fLuma;
}
#endif
#if defined(FSR2_BIND_SRV_NEW_LOCKS) || defined(FFX_INTERNAL)
FfxFloat32 LoadNewLocks(FfxUInt32x2 iPxPos)
{
return r_new_locks[iPxPos];
}
#endif
#if defined(FSR2_BIND_UAV_NEW_LOCKS) || defined(FFX_INTERNAL)
FfxFloat32 LoadRwNewLocks(FfxUInt32x2 iPxPos)
{
return rw_new_locks[iPxPos];
}
#endif
#if defined(FSR2_BIND_UAV_NEW_LOCKS) || defined(FFX_INTERNAL)
void StoreNewLocks(FfxUInt32x2 iPxPos, FfxFloat32 newLock)
{
rw_new_locks[iPxPos] = newLock;
}
#endif
#if defined(FSR2_BIND_UAV_PREPARED_INPUT_COLOR) || defined(FFX_INTERNAL)
void StorePreparedInputColor(FFX_PARAMETER_IN FfxUInt32x2 iPxPos, FFX_PARAMETER_IN FfxFloat32x4 fTonemapped)
{
rw_prepared_input_color[iPxPos] = fTonemapped;
}
#endif
#if defined(FSR2_BIND_SRV_PREPARED_INPUT_COLOR) || defined(FFX_INTERNAL)
FfxFloat32 SampleDepthClip(FfxFloat32x2 fUV)
{
return r_prepared_input_color.SampleLevel(s_LinearClamp, fUV, 0).w;
}
#endif
#if defined(FSR2_BIND_SRV_LOCK_STATUS) || defined(FFX_INTERNAL)
FfxFloat32x2 SampleLockStatus(FfxFloat32x2 fUV)
{
FfxFloat32x2 fLockStatus = r_lock_status.SampleLevel(s_LinearClamp, fUV, 0);
return fLockStatus;
}
#endif
#if defined(FSR2_BIND_SRV_RECONSTRUCTED_PREV_NEAREST_DEPTH) || defined(FFX_INTERNAL)
FfxFloat32 LoadReconstructedPrevDepth(FfxUInt32x2 iPxPos)
{
return asfloat(r_reconstructed_previous_nearest_depth[iPxPos]);
}
#endif
#if defined(FSR2_BIND_UAV_RECONSTRUCTED_PREV_NEAREST_DEPTH) || defined(FFX_INTERNAL)
void StoreReconstructedDepth(FfxUInt32x2 iPxSample, FfxFloat32 fDepth)
{
FfxUInt32 uDepth = asuint(fDepth);
#if FFX_FSR2_OPTION_INVERTED_DEPTH
InterlockedMax(rw_reconstructed_previous_nearest_depth[iPxSample], uDepth);
#else
InterlockedMin(rw_reconstructed_previous_nearest_depth[iPxSample], uDepth); // min for standard, max for inverted depth
#endif
}
#endif
#if defined(FSR2_BIND_UAV_RECONSTRUCTED_PREV_NEAREST_DEPTH) || defined(FFX_INTERNAL)
void SetReconstructedDepth(FfxUInt32x2 iPxSample, const FfxUInt32 uValue)
{
rw_reconstructed_previous_nearest_depth[iPxSample] = uValue;
}
#endif
#if defined(FSR2_BIND_UAV_DILATED_DEPTH) || defined(FFX_INTERNAL)
void StoreDilatedDepth(FFX_PARAMETER_IN FfxUInt32x2 iPxPos, FFX_PARAMETER_IN FfxFloat32 fDepth)
{
rw_dilatedDepth[iPxPos] = fDepth;
}
#endif
#if defined(FSR2_BIND_UAV_DILATED_MOTION_VECTORS) || defined(FFX_INTERNAL)
void StoreDilatedMotionVector(FFX_PARAMETER_IN FfxUInt32x2 iPxPos, FFX_PARAMETER_IN FfxFloat32x2 fMotionVector)
{
rw_dilated_motion_vectors[iPxPos] = fMotionVector;
}
#endif
#if defined(FSR2_BIND_SRV_DILATED_MOTION_VECTORS) || defined(FFX_INTERNAL)
FfxFloat32x2 LoadDilatedMotionVector(FfxUInt32x2 iPxInput)
{
return r_dilated_motion_vectors[iPxInput].xy;
}
#endif
#if defined(FSR2_BIND_SRV_PREVIOUS_DILATED_MOTION_VECTORS) || defined(FFX_INTERNAL)
FfxFloat32x2 LoadPreviousDilatedMotionVector(FfxUInt32x2 iPxInput)
{
return r_previous_dilated_motion_vectors[iPxInput].xy;
}
FfxFloat32x2 SamplePreviousDilatedMotionVector(FfxFloat32x2 uv)
{
return r_previous_dilated_motion_vectors.SampleLevel(s_LinearClamp, uv, 0).xy;
}
#endif
#if defined(FSR2_BIND_SRV_DILATED_DEPTH) || defined(FFX_INTERNAL)
FfxFloat32 LoadDilatedDepth(FfxUInt32x2 iPxInput)
{
return r_dilatedDepth[iPxInput];
}
#endif
#if defined(FSR2_BIND_SRV_INPUT_EXPOSURE) || defined(FFX_INTERNAL)
FfxFloat32 Exposure()
{
FfxFloat32 exposure = r_input_exposure[FfxUInt32x2(0, 0)].x;
if (exposure == 0.0f) {
exposure = 1.0f;
}
return exposure;
}
#endif
#if defined(FSR2_BIND_SRV_AUTO_EXPOSURE) || defined(FFX_INTERNAL)
FfxFloat32 AutoExposure()
{
FfxFloat32 exposure = r_auto_exposure[FfxUInt32x2(0, 0)].x;
if (exposure == 0.0f) {
exposure = 1.0f;
}
return exposure;
}
#endif
FfxFloat32 SampleLanczos2Weight(FfxFloat32 x)
{
#if defined(FSR2_BIND_SRV_LANCZOS_LUT) || defined(FFX_INTERNAL)
return r_lanczos_lut.SampleLevel(s_LinearClamp, FfxFloat32x2(x / 2, 0.5f), 0);
#else
return 0.f;
#endif
}
#if defined(FSR2_BIND_SRV_UPSCALE_MAXIMUM_BIAS_LUT) || defined(FFX_INTERNAL)
FfxFloat32 SampleUpsampleMaximumBias(FfxFloat32x2 uv)
{
// Stored as a SNORM, so make sure to multiply by 2 to retrieve the actual expected range.
return FfxFloat32(2.0) * r_upsample_maximum_bias_lut.SampleLevel(s_LinearClamp, abs(uv) * 2.0, 0);
}
#endif
#if defined(FSR2_BIND_SRV_DILATED_REACTIVE_MASKS) || defined(FFX_INTERNAL)
FfxFloat32x2 SampleDilatedReactiveMasks(FfxFloat32x2 fUV)
{
return r_dilated_reactive_masks.SampleLevel(s_LinearClamp, fUV, 0);
}
#endif
#if defined(FSR2_BIND_SRV_DILATED_REACTIVE_MASKS) || defined(FFX_INTERNAL)
FfxFloat32x2 LoadDilatedReactiveMasks(FFX_PARAMETER_IN FfxUInt32x2 iPxPos)
{
return r_dilated_reactive_masks[iPxPos];
}
#endif
#if defined(FSR2_BIND_UAV_DILATED_REACTIVE_MASKS) || defined(FFX_INTERNAL)
void StoreDilatedReactiveMasks(FFX_PARAMETER_IN FfxUInt32x2 iPxPos, FFX_PARAMETER_IN FfxFloat32x2 fDilatedReactiveMasks)
{
rw_dilated_reactive_masks[iPxPos] = fDilatedReactiveMasks;
}
#endif
#if defined(FSR2_BIND_SRV_INPUT_OPAQUE_ONLY) || defined(FFX_INTERNAL)
FfxFloat32x3 LoadOpaqueOnly(FFX_PARAMETER_IN FFX_MIN16_I2 iPxPos)
{
return r_input_opaque_only[UNITY_FSR2_POS(iPxPos)].xyz;
}
#endif
#if defined(FSR2_BIND_SRV_PREV_PRE_ALPHA_COLOR) || defined(FFX_INTERNAL)
FfxFloat32x3 LoadPrevPreAlpha(FFX_PARAMETER_IN FFX_MIN16_I2 iPxPos)
{
return r_input_prev_color_pre_alpha[iPxPos];
}
#endif
#if defined(FSR2_BIND_SRV_PREV_POST_ALPHA_COLOR) || defined(FFX_INTERNAL)
FfxFloat32x3 LoadPrevPostAlpha(FFX_PARAMETER_IN FFX_MIN16_I2 iPxPos)
{
return r_input_prev_color_post_alpha[iPxPos];
}
#endif
#if defined(FSR2_BIND_UAV_AUTOREACTIVE) || defined(FFX_INTERNAL)
#if defined(FSR2_BIND_UAV_AUTOCOMPOSITION) || defined(FFX_INTERNAL)
void StoreAutoReactive(FFX_PARAMETER_IN FFX_MIN16_I2 iPxPos, FFX_PARAMETER_IN FFX_MIN16_F2 fReactive)
{
rw_output_autoreactive[iPxPos] = fReactive.x;
rw_output_autocomposition[iPxPos] = fReactive.y;
}
#endif
#endif
#if defined(FSR2_BIND_UAV_PREV_PRE_ALPHA_COLOR) || defined(FFX_INTERNAL)
void StorePrevPreAlpha(FFX_PARAMETER_IN FFX_MIN16_I2 iPxPos, FFX_PARAMETER_IN FFX_MIN16_F3 color)
{
rw_output_prev_color_pre_alpha[iPxPos] = color;
}
#endif
#if defined(FSR2_BIND_UAV_PREV_POST_ALPHA_COLOR) || defined(FFX_INTERNAL)
void StorePrevPostAlpha(FFX_PARAMETER_IN FFX_MIN16_I2 iPxPos, FFX_PARAMETER_IN FFX_MIN16_F3 color)
{
rw_output_prev_color_post_alpha[iPxPos] = color;
}
#endif
#endif // #if defined(FFX_GPU)

60
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_callbacks_hlsl.h.meta

@ -1,60 +0,0 @@
fileFormatVersion: 2
guid: eb121968296f9ba44b35d7e18d2b79df
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude GameCoreScarlett: 1
Exclude GameCoreXboxOne: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude PS4: 1
Exclude PS5: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

60
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_common.h.meta

@ -1,60 +0,0 @@
fileFormatVersion: 2
guid: 2176dca22b6e9604da8329c79abae68d
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude GameCoreScarlett: 1
Exclude GameCoreXboxOne: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude PS4: 1
Exclude PS5: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

60
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_compute_luminance_pyramid.h.meta

@ -1,60 +0,0 @@
fileFormatVersion: 2
guid: dbcdb6dfb36311a49aa7b05bc5054280
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude GameCoreScarlett: 1
Exclude GameCoreXboxOne: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude PS4: 1
Exclude PS5: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

131
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_compute_luminance_pyramid_pass.hlsl

@ -1,131 +0,0 @@
// This file is part of the FidelityFX SDK.
//
// Copyright (c) 2022-2023 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.
#define FSR2_BIND_SRV_INPUT_COLOR 0
#define FSR2_BIND_UAV_SPD_GLOBAL_ATOMIC 0
#define FSR2_BIND_UAV_EXPOSURE_MIP_LUMA_CHANGE 1
#define FSR2_BIND_UAV_EXPOSURE_MIP_5 2
#define FSR2_BIND_UAV_AUTO_EXPOSURE 3
#define FSR2_BIND_CB_FSR2 0
#define FSR2_BIND_CB_SPD 1
#include "ffx_fsr2_callbacks_hlsl.h"
#include "ffx_fsr2_common.h"
#if defined(FSR2_BIND_CB_SPD)
cbuffer cbSPD : FFX_FSR2_DECLARE_CB(FSR2_BIND_CB_SPD) {
FfxUInt32 mips;
FfxUInt32 numWorkGroups;
FfxUInt32x2 workGroupOffset;
FfxUInt32x2 renderSize;
};
FfxUInt32 MipCount()
{
return mips;
}
FfxUInt32 NumWorkGroups()
{
return numWorkGroups;
}
FfxUInt32x2 WorkGroupOffset()
{
return workGroupOffset;
}
FfxUInt32x2 SPD_RenderSize()
{
return renderSize;
}
#endif
FfxFloat32x2 SPD_LoadExposureBuffer()
{
return rw_auto_exposure[FfxInt32x2(0,0)];
}
void SPD_SetExposureBuffer(FfxFloat32x2 value)
{
rw_auto_exposure[FfxInt32x2(0,0)] = value;
}
FfxFloat32x4 SPD_LoadMipmap5(FfxInt32x2 iPxPos)
{
return FfxFloat32x4(rw_img_mip_5[iPxPos], 0, 0, 0);
}
void SPD_SetMipmap(FfxInt32x2 iPxPos, FfxInt32 slice, FfxFloat32 value)
{
switch (slice)
{
case FFX_FSR2_SHADING_CHANGE_MIP_LEVEL:
rw_img_mip_shading_change[iPxPos] = value;
break;
case 5:
rw_img_mip_5[iPxPos] = value;
break;
default:
// avoid flattened side effect
#if defined(FSR2_BIND_UAV_EXPOSURE_MIP_LUMA_CHANGE) || defined(FFX_INTERNAL)
rw_img_mip_shading_change[iPxPos] = rw_img_mip_shading_change[iPxPos];
#elif defined(FSR2_BIND_UAV_EXPOSURE_MIP_5) || defined(FFX_INTERNAL)
rw_img_mip_5[iPxPos] = rw_img_mip_5[iPxPos];
#endif
break;
}
}
void SPD_IncreaseAtomicCounter(inout FfxUInt32 spdCounter)
{
InterlockedAdd(rw_spd_global_atomic[FfxInt32x2(0,0)], 1, spdCounter);
}
void SPD_ResetAtomicCounter()
{
rw_spd_global_atomic[FfxInt32x2(0,0)] = 0;
}
#include "ffx_fsr2_compute_luminance_pyramid.h"
#ifndef FFX_FSR2_THREAD_GROUP_WIDTH
#define FFX_FSR2_THREAD_GROUP_WIDTH 256
#endif // #ifndef FFX_FSR2_THREAD_GROUP_WIDTH
#ifndef FFX_FSR2_THREAD_GROUP_HEIGHT
#define FFX_FSR2_THREAD_GROUP_HEIGHT 1
#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_CB2_ROOTSIG_CONTENT
void CS(uint3 WorkGroupId : SV_GroupID, uint LocalThreadIndex : SV_GroupIndex)
{
ComputeAutoExposure(WorkGroupId, LocalThreadIndex);
}

60
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_depth_clip.h.meta

@ -1,60 +0,0 @@
fileFormatVersion: 2
guid: f7c16477aeb3a9b4f94f4ef818d10d9b
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude GameCoreScarlett: 1
Exclude GameCoreXboxOne: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude PS4: 1
Exclude PS5: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

66
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_depth_clip_pass.hlsl

@ -1,66 +0,0 @@
// This file is part of the FidelityFX SDK.
//
// Copyright (c) 2022-2023 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.
#define FSR2_BIND_SRV_RECONSTRUCTED_PREV_NEAREST_DEPTH 0
#define FSR2_BIND_SRV_DILATED_MOTION_VECTORS 1
#define FSR2_BIND_SRV_DILATED_DEPTH 2
#define FSR2_BIND_SRV_REACTIVE_MASK 3
#define FSR2_BIND_SRV_TRANSPARENCY_AND_COMPOSITION_MASK 4
#define FSR2_BIND_SRV_PREVIOUS_DILATED_MOTION_VECTORS 5
#define FSR2_BIND_SRV_INPUT_MOTION_VECTORS 6
#define FSR2_BIND_SRV_INPUT_COLOR 7
#define FSR2_BIND_SRV_INPUT_DEPTH 8
#define FSR2_BIND_SRV_INPUT_EXPOSURE 9
#define FSR2_BIND_UAV_DILATED_REACTIVE_MASKS 0
#define FSR2_BIND_UAV_PREPARED_INPUT_COLOR 1
#define FSR2_BIND_CB_FSR2 0
#include "ffx_fsr2_callbacks_hlsl.h"
#include "ffx_fsr2_common.h"
#include "ffx_fsr2_sample.h"
#include "ffx_fsr2_depth_clip.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_PREFER_WAVE64
FFX_FSR2_NUM_THREADS
FFX_FSR2_EMBED_ROOTSIG_CONTENT
void CS(
int2 iGroupId : SV_GroupID,
int2 iDispatchThreadId : SV_DispatchThreadID,
int2 iGroupThreadId : SV_GroupThreadID,
int iGroupIndex : SV_GroupIndex)
{
DepthClip(iDispatchThreadId);
}

60
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_lock.h.meta

@ -1,60 +0,0 @@
fileFormatVersion: 2
guid: 9b4cdc5f81194ac4fa946c31b86234ed
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude GameCoreScarlett: 1
Exclude GameCoreXboxOne: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude PS4: 1
Exclude PS5: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

53
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_lock_pass.hlsl

@ -1,53 +0,0 @@
// This file is part of the FidelityFX SDK.
//
// Copyright (c) 2022-2023 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.
#define FSR2_BIND_SRV_LOCK_INPUT_LUMA 0
#define FSR2_BIND_UAV_NEW_LOCKS 0
#define FSR2_BIND_UAV_RECONSTRUCTED_PREV_NEAREST_DEPTH 1
#define FSR2_BIND_CB_FSR2 0
#include "ffx_fsr2_callbacks_hlsl.h"
#include "ffx_fsr2_common.h"
#include "ffx_fsr2_sample.h"
#include "ffx_fsr2_lock.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_PREFER_WAVE64
FFX_FSR2_NUM_THREADS
FFX_FSR2_EMBED_ROOTSIG_CONTENT
void CS(uint2 uGroupId : SV_GroupID, uint2 uGroupThreadId : SV_GroupThreadID)
{
uint2 uDispatchThreadId = uGroupId * uint2(FFX_FSR2_THREAD_GROUP_WIDTH, FFX_FSR2_THREAD_GROUP_HEIGHT) + uGroupThreadId;
ComputeLock(uDispatchThreadId);
}

7
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_lock_pass.hlsl.meta

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 471a3f7a033c72f4fa737d4f8238a9bd
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

60
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_postprocess_lock_status.h.meta

@ -1,60 +0,0 @@
fileFormatVersion: 2
guid: 3945c3cfd2cc1a64cb0513864d88d8ca
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude GameCoreScarlett: 1
Exclude GameCoreXboxOne: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude PS4: 1
Exclude PS5: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

60
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_rcas.h.meta

@ -1,60 +0,0 @@
fileFormatVersion: 2
guid: 7bd7d4eb34c626342966cb9b3fe00363
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude GameCoreScarlett: 1
Exclude GameCoreXboxOne: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude PS4: 1
Exclude PS5: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

75
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_rcas_pass.hlsl

@ -1,75 +0,0 @@
// This file is part of the FidelityFX SDK.
//
// Copyright (c) 2022-2023 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.
#define FSR2_BIND_SRV_INPUT_EXPOSURE 0
#define FSR2_BIND_SRV_RCAS_INPUT 1
#define FSR2_BIND_UAV_UPSCALED_OUTPUT 0
#define FSR2_BIND_CB_FSR2 0
#define FSR2_BIND_CB_RCAS 1
#include "ffx_fsr2_callbacks_hlsl.h"
#include "ffx_fsr2_common.h"
//Move to prototype shader!
#if defined(FSR2_BIND_CB_RCAS)
cbuffer cbRCAS : FFX_FSR2_DECLARE_CB(FSR2_BIND_CB_RCAS)
{
uint4 rcasConfig;
};
uint4 RCASConfig()
{
return rcasConfig;
}
#else
uint4 RCASConfig()
{
return 0;
}
#endif
float4 LoadRCAS_Input(FfxInt32x2 iPxPos)
{
return r_rcas_input[iPxPos];
}
#include "ffx_fsr2_rcas.h"
#ifndef FFX_FSR2_THREAD_GROUP_WIDTH
#define FFX_FSR2_THREAD_GROUP_WIDTH 64
#endif // #ifndef FFX_FSR2_THREAD_GROUP_WIDTH
#ifndef FFX_FSR2_THREAD_GROUP_HEIGHT
#define FFX_FSR2_THREAD_GROUP_HEIGHT 1
#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_CB2_ROOTSIG_CONTENT
void CS(uint3 LocalThreadId : SV_GroupThreadID, uint3 WorkGroupId : SV_GroupID, uint3 Dtid : SV_DispatchThreadID)
{
RCAS(LocalThreadId, WorkGroupId, Dtid);
}

7
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_rcas_pass.hlsl.meta

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 871ca1938c701d64f94ef8ec00ef06f4
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

60
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_reconstruct_dilated_velocity_and_previous_depth.h.meta

@ -1,60 +0,0 @@
fileFormatVersion: 2
guid: 13cd33c3d34a317409049dfd939e64ef
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude GameCoreScarlett: 1
Exclude GameCoreXboxOne: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude PS4: 1
Exclude PS5: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

63
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_reconstruct_previous_depth_pass.hlsl

@ -1,63 +0,0 @@
// This file is part of the FidelityFX SDK.
//
// Copyright (c) 2022-2023 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.
#define FSR2_BIND_SRV_INPUT_MOTION_VECTORS 0
#define FSR2_BIND_SRV_INPUT_DEPTH 1
#define FSR2_BIND_SRV_INPUT_COLOR 2
#define FSR2_BIND_SRV_INPUT_EXPOSURE 3
#define FSR2_BIND_UAV_RECONSTRUCTED_PREV_NEAREST_DEPTH 0
#define FSR2_BIND_UAV_DILATED_MOTION_VECTORS 1
#define FSR2_BIND_UAV_DILATED_DEPTH 2
#define FSR2_BIND_UAV_LOCK_INPUT_LUMA 3
#define FSR2_BIND_CB_FSR2 0
#include "ffx_fsr2_callbacks_hlsl.h"
#include "ffx_fsr2_common.h"
#include "ffx_fsr2_sample.h"
#include "ffx_fsr2_reconstruct_dilated_velocity_and_previous_depth.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_PREFER_WAVE64
FFX_FSR2_NUM_THREADS
FFX_FSR2_EMBED_ROOTSIG_CONTENT
void CS(
int2 iGroupId : SV_GroupID,
int2 iDispatchThreadId : SV_DispatchThreadID,
int2 iGroupThreadId : SV_GroupThreadID,
int iGroupIndex : SV_GroupIndex
)
{
ReconstructAndDilate(iDispatchThreadId);
}

7
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_reconstruct_previous_depth_pass.hlsl.meta

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 9355c255c8505ae48ae89af286943747
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

60
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_reproject.h.meta

@ -1,60 +0,0 @@
fileFormatVersion: 2
guid: 63fc917ca6895cb4aac237ea35edb838
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude GameCoreScarlett: 1
Exclude GameCoreXboxOne: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude PS4: 1
Exclude PS5: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

105
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_resources.h

@ -1,105 +0,0 @@
// This file is part of the FidelityFX SDK.
//
// Copyright (c) 2022-2023 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_RESOURCES_H
#define FFX_FSR2_RESOURCES_H
#if defined(FFX_CPU) || defined(FFX_GPU)
#define FFX_FSR2_RESOURCE_IDENTIFIER_NULL 0
#define FFX_FSR2_RESOURCE_IDENTIFIER_INPUT_OPAQUE_ONLY 1
#define FFX_FSR2_RESOURCE_IDENTIFIER_INPUT_COLOR 2
#define FFX_FSR2_RESOURCE_IDENTIFIER_INPUT_MOTION_VECTORS 3
#define FFX_FSR2_RESOURCE_IDENTIFIER_INPUT_DEPTH 4
#define FFX_FSR2_RESOURCE_IDENTIFIER_INPUT_EXPOSURE 5
#define FFX_FSR2_RESOURCE_IDENTIFIER_INPUT_REACTIVE_MASK 6
#define FFX_FSR2_RESOURCE_IDENTIFIER_INPUT_TRANSPARENCY_AND_COMPOSITION_MASK 7
#define FFX_FSR2_RESOURCE_IDENTIFIER_RECONSTRUCTED_PREVIOUS_NEAREST_DEPTH 8
#define FFX_FSR2_RESOURCE_IDENTIFIER_DILATED_MOTION_VECTORS 9
#define FFX_FSR2_RESOURCE_IDENTIFIER_DILATED_DEPTH 10
#define FFX_FSR2_RESOURCE_IDENTIFIER_INTERNAL_UPSCALED_COLOR 11
#define FFX_FSR2_RESOURCE_IDENTIFIER_LOCK_STATUS 12
#define FFX_FSR2_RESOURCE_IDENTIFIER_NEW_LOCKS 13
#define FFX_FSR2_RESOURCE_IDENTIFIER_PREPARED_INPUT_COLOR 14
#define FFX_FSR2_RESOURCE_IDENTIFIER_LUMA_HISTORY 15
#define FFX_FSR2_RESOURCE_IDENTIFIER_DEBUG_OUTPUT 16
#define FFX_FSR2_RESOURCE_IDENTIFIER_LANCZOS_LUT 17
#define FFX_FSR2_RESOURCE_IDENTIFIER_SPD_ATOMIC_COUNT 18
#define FFX_FSR2_RESOURCE_IDENTIFIER_UPSCALED_OUTPUT 19
#define FFX_FSR2_RESOURCE_IDENTIFIER_RCAS_INPUT 20
#define FFX_FSR2_RESOURCE_IDENTIFIER_LOCK_STATUS_1 21
#define FFX_FSR2_RESOURCE_IDENTIFIER_LOCK_STATUS_2 22
#define FFX_FSR2_RESOURCE_IDENTIFIER_INTERNAL_UPSCALED_COLOR_1 23
#define FFX_FSR2_RESOURCE_IDENTIFIER_INTERNAL_UPSCALED_COLOR_2 24
#define FFX_FSR2_RESOURCE_IDENTIFIER_INTERNAL_DEFAULT_REACTIVITY 25
#define FFX_FSR2_RESOURCE_IDENTIFIER_INTERNAL_DEFAULT_TRANSPARENCY_AND_COMPOSITION 26
#define FFX_FSR2_RESOURCE_IDENTITIER_UPSAMPLE_MAXIMUM_BIAS_LUT 27
#define FFX_FSR2_RESOURCE_IDENTIFIER_DILATED_REACTIVE_MASKS 28
#define FFX_FSR2_RESOURCE_IDENTIFIER_SCENE_LUMINANCE 29 // same as FFX_FSR2_RESOURCE_IDENTIFIER_SCENE_LUMINANCE_MIPMAP_0
#define FFX_FSR2_RESOURCE_IDENTIFIER_SCENE_LUMINANCE_MIPMAP_0 29
#define FFX_FSR2_RESOURCE_IDENTIFIER_SCENE_LUMINANCE_MIPMAP_1 30
#define FFX_FSR2_RESOURCE_IDENTIFIER_SCENE_LUMINANCE_MIPMAP_2 31
#define FFX_FSR2_RESOURCE_IDENTIFIER_SCENE_LUMINANCE_MIPMAP_3 32
#define FFX_FSR2_RESOURCE_IDENTIFIER_SCENE_LUMINANCE_MIPMAP_4 33
#define FFX_FSR2_RESOURCE_IDENTIFIER_SCENE_LUMINANCE_MIPMAP_5 34
#define FFX_FSR2_RESOURCE_IDENTIFIER_SCENE_LUMINANCE_MIPMAP_6 35
#define FFX_FSR2_RESOURCE_IDENTIFIER_SCENE_LUMINANCE_MIPMAP_7 36
#define FFX_FSR2_RESOURCE_IDENTIFIER_SCENE_LUMINANCE_MIPMAP_8 37
#define FFX_FSR2_RESOURCE_IDENTIFIER_SCENE_LUMINANCE_MIPMAP_9 38
#define FFX_FSR2_RESOURCE_IDENTIFIER_SCENE_LUMINANCE_MIPMAP_10 39
#define FFX_FSR2_RESOURCE_IDENTIFIER_SCENE_LUMINANCE_MIPMAP_11 40
#define FFX_FSR2_RESOURCE_IDENTIFIER_SCENE_LUMINANCE_MIPMAP_12 41
#define FFX_FSR2_RESOURCE_IDENTIFIER_INTERNAL_DEFAULT_EXPOSURE 42
#define FFX_FSR2_RESOURCE_IDENTIFIER_AUTO_EXPOSURE 43
#define FFX_FSR2_RESOURCE_IDENTIFIER_AUTOREACTIVE 44
#define FFX_FSR2_RESOURCE_IDENTIFIER_AUTOCOMPOSITION 45
#define FFX_FSR2_RESOURCE_IDENTIFIER_PREV_PRE_ALPHA_COLOR 46
#define FFX_FSR2_RESOURCE_IDENTIFIER_PREV_POST_ALPHA_COLOR 47
#define FFX_FSR2_RESOURCE_IDENTIFIER_PREV_PRE_ALPHA_COLOR_1 48
#define FFX_FSR2_RESOURCE_IDENTIFIER_PREV_POST_ALPHA_COLOR_1 49
#define FFX_FSR2_RESOURCE_IDENTIFIER_PREV_PRE_ALPHA_COLOR_2 50
#define FFX_FSR2_RESOURCE_IDENTIFIER_PREV_POST_ALPHA_COLOR_2 51
#define FFX_FSR2_RESOURCE_IDENTIFIER_PREVIOUS_DILATED_MOTION_VECTORS 52
#define FFX_FSR2_RESOURCE_IDENTIFIER_INTERNAL_DILATED_MOTION_VECTORS_1 53
#define FFX_FSR2_RESOURCE_IDENTIFIER_INTERNAL_DILATED_MOTION_VECTORS_2 54
#define FFX_FSR2_RESOURCE_IDENTIFIER_LUMA_HISTORY_1 55
#define FFX_FSR2_RESOURCE_IDENTIFIER_LUMA_HISTORY_2 56
#define FFX_FSR2_RESOURCE_IDENTIFIER_LOCK_INPUT_LUMA 57
// Shading change detection mip level setting, value must be in the range [FFX_FSR2_RESOURCE_IDENTIFIER_SCENE_LUMINANCE_MIPMAP_0, FFX_FSR2_RESOURCE_IDENTIFIER_SCENE_LUMINANCE_MIPMAP_12]
#define FFX_FSR2_RESOURCE_IDENTIFIER_SCENE_LUMINANCE_MIPMAP_SHADING_CHANGE FFX_FSR2_RESOURCE_IDENTIFIER_SCENE_LUMINANCE_MIPMAP_4
#define FFX_FSR2_SHADING_CHANGE_MIP_LEVEL (FFX_FSR2_RESOURCE_IDENTIFIER_SCENE_LUMINANCE_MIPMAP_SHADING_CHANGE - FFX_FSR2_RESOURCE_IDENTIFIER_SCENE_LUMINANCE)
#define FFX_FSR2_RESOURCE_IDENTIFIER_COUNT 58
#define FFX_FSR2_CONSTANTBUFFER_IDENTIFIER_FSR2 0
#define FFX_FSR2_CONSTANTBUFFER_IDENTIFIER_SPD 1
#define FFX_FSR2_CONSTANTBUFFER_IDENTIFIER_RCAS 2
#define FFX_FSR2_CONSTANTBUFFER_IDENTIFIER_GENREACTIVE 3
#define FFX_FSR2_AUTOREACTIVEFLAGS_APPLY_TONEMAP 1
#define FFX_FSR2_AUTOREACTIVEFLAGS_APPLY_INVERSETONEMAP 2
#define FFX_FSR2_AUTOREACTIVEFLAGS_APPLY_THRESHOLD 4
#define FFX_FSR2_AUTOREACTIVEFLAGS_USE_COMPONENTS_MAX 8
#endif // #if defined(FFX_CPU) || defined(FFX_GPU)
#endif //!defined( FFX_FSR2_RESOURCES_H )

60
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_resources.h.meta

@ -1,60 +0,0 @@
fileFormatVersion: 2
guid: fd5bed2bf4ba07444ae815390168a15d
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude GameCoreScarlett: 1
Exclude GameCoreXboxOne: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude PS4: 1
Exclude PS5: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

60
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_sample.h.meta

@ -1,60 +0,0 @@
fileFormatVersion: 2
guid: ba3ee190167b6c240aaeb1f8f4dbcb67
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude GameCoreScarlett: 1
Exclude GameCoreXboxOne: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude PS4: 1
Exclude PS5: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

60
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_tcr_autogen.h.meta

@ -1,60 +0,0 @@
fileFormatVersion: 2
guid: 18b8590c99b171a4e9af68dfd2c3ff02
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude GameCoreScarlett: 1
Exclude GameCoreXboxOne: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude PS4: 1
Exclude PS5: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

7
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_tcr_autogen_pass.hlsl.meta

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 9feb1fa4d6cff5a4799298dc69b12a8e
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

60
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_upsample.h.meta

@ -1,60 +0,0 @@
fileFormatVersion: 2
guid: 1ff3a385cfe07db4387e4d7b457238f8
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude GameCoreScarlett: 1
Exclude GameCoreXboxOne: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude PS4: 1
Exclude PS5: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

60
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_spd.h.meta

@ -1,60 +0,0 @@
fileFormatVersion: 2
guid: 3ef69a900a925bb498651c10581e0979
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude GameCoreScarlett: 1
Exclude GameCoreXboxOne: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude PS4: 1
Exclude PS5: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

2
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2.meta → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: cad7d53fa2166a0449bec7a9b4f17d69
guid: 37c436021e67c00459f44b59099c024a
folderAsset: yes
DefaultImporter:
externalObjects: {}

24
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/ffx_fsr2_accumulate_pass.compute → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_accumulate_pass.compute

@ -21,21 +21,21 @@
#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
#pragma multi_compile_local __ FFX_FSR3UPSCALER_OPTION_REPROJECT_USE_LANCZOS_TYPE
#pragma multi_compile_local __ FFX_FSR3UPSCALER_OPTION_HDR_COLOR_INPUT
#pragma multi_compile_local __ FFX_FSR3UPSCALER_OPTION_LOW_RESOLUTION_MOTION_VECTORS
#pragma multi_compile_local __ FFX_FSR3UPSCALER_OPTION_JITTERED_MOTION_VECTORS
#pragma multi_compile_local __ FFX_FSR3UPSCALER_OPTION_INVERTED_DEPTH
#pragma multi_compile_local __ FFX_FSR3UPSCALER_OPTION_APPLY_SHARPENING
#pragma multi_compile_local __ UNITY_FSR2_HDRP
#pragma multi_compile_local __ UNITY_FSR3UPSCALER_HDRP
#include "ffx_fsr2_unity_common.cginc"
#include "ffx_fsr3upscaler_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_FSR2_OPTION_REPROJECT_USE_LANCZOS_TYPE
#undef FFX_FSR2_OPTION_REPROJECT_USE_LANCZOS_TYPE
#define FFX_FSR2_OPTION_REPROJECT_USE_LANCZOS_TYPE 1
#ifdef FFX_FSR3UPSCALER_OPTION_REPROJECT_USE_LANCZOS_TYPE
#undef FFX_FSR3UPSCALER_OPTION_REPROJECT_USE_LANCZOS_TYPE
#define FFX_FSR3UPSCALER_OPTION_REPROJECT_USE_LANCZOS_TYPE 1
#endif
#include "shaders/ffx_fsr2_accumulate_pass.hlsl"
#include "shaders/ffx_fsr3upscaler_accumulate_pass.hlsl"

2
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/ffx_fsr2_compute_luminance_pyramid_pass.compute.meta → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_accumulate_pass.compute.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 0894ebeefb6aa7d4680c71dffbda3fee
guid: c9b45f0ae7673694ba57a4aadfe212e9
ComputeShaderImporter:
externalObjects: {}
preprocessorOverride: 0

12
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/ffx_fsr2_depth_clip_pass.compute → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_autogen_reactive_pass.compute

@ -21,12 +21,12 @@
#pragma kernel CS
#pragma multi_compile_local __ FFX_HALF
#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_FSR3UPSCALER_OPTION_LOW_RESOLUTION_MOTION_VECTORS
#pragma multi_compile_local __ FFX_FSR3UPSCALER_OPTION_JITTERED_MOTION_VECTORS
#pragma multi_compile_local __ FFX_FSR3UPSCALER_OPTION_INVERTED_DEPTH
#pragma multi_compile_local __ UNITY_FSR2_HDRP
#pragma multi_compile_local __ UNITY_FSR3UPSCALER_HDRP
#include "ffx_fsr2_unity_common.cginc"
#include "ffx_fsr3upscaler_unity_common.cginc"
#include "shaders/ffx_fsr2_depth_clip_pass.hlsl"
#include "shaders/ffx_fsr3upscaler_autogen_reactive_pass.hlsl"

2
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/ffx_fsr2_autogen_reactive_pass.compute.meta → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_autogen_reactive_pass.compute.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: d18fb8811ca4753469c439784546104e
guid: 5716b91fdaa4e9e439df6b96a796fe6e
ComputeShaderImporter:
externalObjects: {}
preprocessorOverride: 0

16
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/ffx_fsr2_compute_luminance_pyramid_pass.compute → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_compute_luminance_pyramid_pass.compute

@ -20,14 +20,14 @@
#pragma kernel CS
//#pragma multi_compile_local __ FFX_HALF // causes a hard-coded error message from the shader include ¯\_(ツ)_/¯
#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_HALF
#pragma multi_compile_local __ FFX_FSR3UPSCALER_OPTION_LOW_RESOLUTION_MOTION_VECTORS
#pragma multi_compile_local __ FFX_FSR3UPSCALER_OPTION_JITTERED_MOTION_VECTORS
#pragma multi_compile_local __ FFX_FSR3UPSCALER_OPTION_INVERTED_DEPTH
#pragma multi_compile_local __ UNITY_FSR2_HDRP
#pragma multi_compile_local __ UNITY_FSR3UPSCALER_HDRP
#include "ffx_fsr2_unity_common.cginc"
#include "ffx_fsr3upscaler_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.
@ -36,7 +36,7 @@
//#pragma require WaveBasic // Required for WaveGetLaneIndex
//#pragma require WaveBallot // Required for WaveReadLaneAt
//#else
#define SPD_NO_WAVE_OPERATIONS
#define FFX_SPD_NO_WAVE_OPERATIONS
//#endif
#include "shaders/ffx_fsr2_compute_luminance_pyramid_pass.hlsl"
#include "shaders/ffx_fsr3upscaler_compute_luminance_pyramid_pass.hlsl"

2
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/ffx_fsr2_depth_clip_pass.compute.meta → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_compute_luminance_pyramid_pass.compute.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 8026d9d8542eab6499c32d5d46beb2b6
guid: d253be05abcdc80428503d3e4cce3a36
ComputeShaderImporter:
externalObjects: {}
preprocessorOverride: 0

12
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/ffx_fsr2_tcr_autogen_pass.compute → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_depth_clip_pass.compute

@ -21,12 +21,12 @@
#pragma kernel CS
#pragma multi_compile_local __ FFX_HALF
#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_FSR3UPSCALER_OPTION_LOW_RESOLUTION_MOTION_VECTORS
#pragma multi_compile_local __ FFX_FSR3UPSCALER_OPTION_JITTERED_MOTION_VECTORS
#pragma multi_compile_local __ FFX_FSR3UPSCALER_OPTION_INVERTED_DEPTH
#pragma multi_compile_local __ UNITY_FSR2_HDRP
#pragma multi_compile_local __ UNITY_FSR3UPSCALER_HDRP
#include "ffx_fsr2_unity_common.cginc"
#include "ffx_fsr3upscaler_unity_common.cginc"
#include "shaders/ffx_fsr2_tcr_autogen_pass.hlsl"
#include "shaders/ffx_fsr3upscaler_depth_clip_pass.hlsl"

2
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/ffx_fsr2_accumulate_pass.compute.meta → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_depth_clip_pass.compute.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 702560780e923c84394c9b22ba460a9c
guid: 20e44016ed34b0d4b8de499d1b566c69
ComputeShaderImporter:
externalObjects: {}
preprocessorOverride: 0

10
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/ffx_fsr2_lock_pass.compute → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_lock_pass.compute

@ -21,10 +21,10 @@
#pragma kernel CS
#pragma multi_compile_local __ FFX_HALF
#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_FSR3UPSCALER_OPTION_LOW_RESOLUTION_MOTION_VECTORS
#pragma multi_compile_local __ FFX_FSR3UPSCALER_OPTION_JITTERED_MOTION_VECTORS
#pragma multi_compile_local __ FFX_FSR3UPSCALER_OPTION_INVERTED_DEPTH
#include "ffx_fsr2_unity_common.cginc"
#include "ffx_fsr3upscaler_unity_common.cginc"
#include "shaders/ffx_fsr2_lock_pass.hlsl"
#include "shaders/ffx_fsr3upscaler_lock_pass.hlsl"

8
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_lock_pass.compute.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a135306e6d1857e43a86ef20db2a47fe
ComputeShaderImporter:
externalObjects: {}
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

10
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/ffx_fsr2_rcas_pass.compute → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_rcas_pass.compute

@ -20,10 +20,10 @@
#pragma kernel CS
#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_FSR3UPSCALER_OPTION_LOW_RESOLUTION_MOTION_VECTORS
#pragma multi_compile_local __ FFX_FSR3UPSCALER_OPTION_JITTERED_MOTION_VECTORS
#pragma multi_compile_local __ FFX_FSR3UPSCALER_OPTION_INVERTED_DEPTH
#include "ffx_fsr2_unity_common.cginc"
#include "ffx_fsr3upscaler_unity_common.cginc"
#include "shaders/ffx_fsr2_rcas_pass.hlsl"
#include "shaders/ffx_fsr3upscaler_rcas_pass.hlsl"

8
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_rcas_pass.compute.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7aaf5cfff022de2499e9b0412f947f6c
ComputeShaderImporter:
externalObjects: {}
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

14
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/ffx_fsr2_reconstruct_previous_depth_pass.compute → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_reconstruct_previous_depth_pass.compute

@ -21,13 +21,13 @@
#pragma kernel CS
#pragma multi_compile_local __ FFX_HALF
#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_FSR3UPSCALER_OPTION_HDR_COLOR_INPUT
#pragma multi_compile_local __ FFX_FSR3UPSCALER_OPTION_LOW_RESOLUTION_MOTION_VECTORS
#pragma multi_compile_local __ FFX_FSR3UPSCALER_OPTION_JITTERED_MOTION_VECTORS
#pragma multi_compile_local __ FFX_FSR3UPSCALER_OPTION_INVERTED_DEPTH
#pragma multi_compile_local __ UNITY_FSR2_HDRP
#pragma multi_compile_local __ UNITY_FSR3UPSCALER_HDRP
#include "ffx_fsr2_unity_common.cginc"
#include "ffx_fsr3upscaler_unity_common.cginc"
#include "shaders/ffx_fsr2_reconstruct_previous_depth_pass.hlsl"
#include "shaders/ffx_fsr3upscaler_reconstruct_previous_depth_pass.hlsl"

8
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_reconstruct_previous_depth_pass.compute.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4f59e5b9179d74844ae06a30ae1e0629
ComputeShaderImporter:
externalObjects: {}
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

12
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/ffx_fsr2_autogen_reactive_pass.compute → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_tcr_autogen_pass.compute

@ -21,12 +21,12 @@
#pragma kernel CS
#pragma multi_compile_local __ FFX_HALF
#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_FSR3UPSCALER_OPTION_LOW_RESOLUTION_MOTION_VECTORS
#pragma multi_compile_local __ FFX_FSR3UPSCALER_OPTION_JITTERED_MOTION_VECTORS
#pragma multi_compile_local __ FFX_FSR3UPSCALER_OPTION_INVERTED_DEPTH
#pragma multi_compile_local __ UNITY_FSR2_HDRP
#pragma multi_compile_local __ UNITY_FSR3UPSCALER_HDRP
#include "ffx_fsr2_unity_common.cginc"
#include "ffx_fsr3upscaler_unity_common.cginc"
#include "shaders/ffx_fsr2_autogen_reactive_pass.hlsl"
#include "shaders/ffx_fsr3upscaler_tcr_autogen_pass.hlsl"

8
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_tcr_autogen_pass.compute.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 75cdc6ef23f08ed498d4da511923fcea
ComputeShaderImporter:
externalObjects: {}
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

11
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/ffx_fsr2_unity_common.cginc → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_unity_common.cginc

@ -1,4 +1,4 @@
// Copyright (c) 2023 Nico de Poel
// Copyright (c) 2023 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
@ -46,7 +46,7 @@
// Workaround for HDRP using texture arrays for its camera buffers on some platforms
// The below defines are copied from: Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/TextureXR.hlsl
#if defined(UNITY_FSR2_HDRP)
#if defined(UNITY_FSR3UPSCALER_HDRP)
// Must be in sync with C# with property useTexArray in TextureXR.cs
#if ((defined(SHADER_API_D3D11) || defined(SHADER_API_D3D12)) && !defined(SHADER_API_XBOXONE) && !defined(SHADER_API_GAMECORE)) || defined(SHADER_API_PSSL) || defined(SHADER_API_VULKAN)
#define UNITY_TEXTURE2D_X_ARRAY_SUPPORTED
@ -73,9 +73,10 @@
#endif
// Declare and sample camera buffers as texture arrays
#define UNITY_FSR2_TEX2D(type) Texture2DArray<type>
#define UNITY_FSR2_POS(pxPos) FfxUInt32x3(pxPos, SLICE_ARRAY_INDEX)
#define UNITY_FSR2_UV(uv) FfxFloat32x3(uv, SLICE_ARRAY_INDEX)
#define UNITY_FSR3_TEX2D(type) Texture2DArray<type>
#define UNITY_FSR3_RWTEX2D(type) RWTexture2DArray<type>
#define UNITY_FSR3_POS(pxPos) FfxUInt32x3(pxPos, SLICE_ARRAY_INDEX)
#define UNITY_FSR3_UV(uv) FfxFloat32x3(uv, SLICE_ARRAY_INDEX)
#endif
#endif

2
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_autogen_reactive_pass.hlsl.meta → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/ffx_fsr3upscaler_unity_common.cginc.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: cc76bd6f46792f3418a56b79eb5c959b
guid: 3ce00ba677bb7e14bb91772fd68bfe6b
ShaderIncludeImporter:
externalObjects: {}
userData:

2
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders.meta → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 4a24e63edc822264a871f58397325d51
guid: 8364d4f86c613ec4d999d062f5f773b8
folderAsset: yes
DefaultImporter:
externalObjects: {}

79
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_accumulate_pass.hlsl

@ -0,0 +1,79 @@
// This file is part of the FidelityFX SDK.
//
// Copyright (c) 2023 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.
#define FSR3UPSCALER_BIND_SRV_INPUT_EXPOSURE 0
#define FSR3UPSCALER_BIND_SRV_DILATED_REACTIVE_MASKS 1
#if FFX_FSR3UPSCALER_OPTION_LOW_RESOLUTION_MOTION_VECTORS
#define FSR3UPSCALER_BIND_SRV_DILATED_MOTION_VECTORS 2
#else
#define FSR3UPSCALER_BIND_SRV_INPUT_MOTION_VECTORS 2
#endif
#define FSR3UPSCALER_BIND_SRV_INTERNAL_UPSCALED 3
#define FSR3UPSCALER_BIND_SRV_LOCK_STATUS 4
#define FSR3UPSCALER_BIND_SRV_PREPARED_INPUT_COLOR 5
#define FSR3UPSCALER_BIND_SRV_LANCZOS_LUT 6
#define FSR3UPSCALER_BIND_SRV_UPSCALE_MAXIMUM_BIAS_LUT 7
#define FSR3UPSCALER_BIND_SRV_SCENE_LUMINANCE_MIPS 8
#define FSR3UPSCALER_BIND_SRV_AUTO_EXPOSURE 9
#define FSR3UPSCALER_BIND_SRV_LUMA_HISTORY 10
#define FSR3UPSCALER_BIND_UAV_INTERNAL_UPSCALED 0
#define FSR3UPSCALER_BIND_UAV_LOCK_STATUS 1
#define FSR3UPSCALER_BIND_UAV_UPSCALED_OUTPUT 2
#define FSR3UPSCALER_BIND_UAV_NEW_LOCKS 3
#define FSR3UPSCALER_BIND_UAV_LUMA_HISTORY 4
#define FSR3UPSCALER_BIND_CB_FSR3UPSCALER 0
#include "fsr3upscaler/ffx_fsr3upscaler_callbacks_hlsl.h"
#include "fsr3upscaler/ffx_fsr3upscaler_common.h"
#include "fsr3upscaler/ffx_fsr3upscaler_sample.h"
#include "fsr3upscaler/ffx_fsr3upscaler_upsample.h"
#include "fsr3upscaler/ffx_fsr3upscaler_postprocess_lock_status.h"
#include "fsr3upscaler/ffx_fsr3upscaler_reproject.h"
#include "fsr3upscaler/ffx_fsr3upscaler_accumulate.h"
#ifndef FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH
#define FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH 8
#endif // #ifndef FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH
#ifndef FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT
#define FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT 8
#endif // FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT
#ifndef FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH
#define FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH 1
#endif // #ifndef FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH
#ifndef FFX_FSR3UPSCALER_NUM_THREADS
#define FFX_FSR3UPSCALER_NUM_THREADS [numthreads(FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH, FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT, FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH)]
#endif // #ifndef FFX_FSR3UPSCALER_NUM_THREADS
FFX_PREFER_WAVE64
FFX_FSR3UPSCALER_NUM_THREADS
FFX_FSR3UPSCALER_EMBED_ROOTSIG_CONTENT
void CS(uint2 uGroupId : SV_GroupID, uint2 uGroupThreadId : SV_GroupThreadID)
{
const uint GroupRows = (uint(DisplaySize().y) + FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT - 1) / FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT;
uGroupId.y = GroupRows - uGroupId.y - 1;
uint2 uDispatchThreadId = uGroupId * uint2(FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH, FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT) + uGroupThreadId;
Accumulate(uDispatchThreadId);
}

2
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_compute_luminance_pyramid_pass.hlsl.meta → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_accumulate_pass.hlsl.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 19dfb00afb70c3144b43ec2dc05ecdd9
guid: 507ab779c38eddb429cdcedf9c108d1b
ShaderIncludeImporter:
externalObjects: {}
userData:

77
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_autogen_reactive_pass.hlsl

@ -0,0 +1,77 @@
// This file is part of the FidelityFX SDK.
//
// Copyright (c) 2023 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.
#define FSR3UPSCALER_BIND_SRV_INPUT_OPAQUE_ONLY 0
#define FSR3UPSCALER_BIND_SRV_INPUT_COLOR 1
#define FSR3UPSCALER_BIND_UAV_AUTOREACTIVE 0
#define FSR3UPSCALER_BIND_CB_FSR3UPSCALER 0
#define FSR3UPSCALER_BIND_CB_REACTIVE 1
#include "fsr3upscaler/ffx_fsr3upscaler_callbacks_hlsl.h"
#include "fsr3upscaler/ffx_fsr3upscaler_common.h"
#ifndef FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH
#define FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH 8
#endif // #ifndef FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH
#ifndef FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT
#define FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT 8
#endif // FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT
#ifndef FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH
#define FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH 1
#endif // #ifndef FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH
#ifndef FFX_FSR3UPSCALER_NUM_THREADS
#define FFX_FSR3UPSCALER_NUM_THREADS [numthreads(FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH, FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT, FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH)]
#endif // #ifndef FFX_FSR3UPSCALER_NUM_THREADS
FFX_FSR3UPSCALER_NUM_THREADS
FFX_FSR3UPSCALER_EMBED_ROOTSIG_CONTENT
void CS(uint2 uGroupId : SV_GroupID, uint2 uGroupThreadId : SV_GroupThreadID)
{
uint2 uDispatchThreadId = uGroupId * uint2(FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH, FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT) + uGroupThreadId;
float3 ColorPreAlpha = LoadOpaqueOnly( FFX_MIN16_I2(uDispatchThreadId) ).rgb;
float3 ColorPostAlpha = LoadInputColor(uDispatchThreadId).rgb;
if (GenReactiveFlags() & FFX_FSR3UPSCALER_AUTOREACTIVEFLAGS_APPLY_TONEMAP)
{
ColorPreAlpha = Tonemap(ColorPreAlpha);
ColorPostAlpha = Tonemap(ColorPostAlpha);
}
if (GenReactiveFlags() & FFX_FSR3UPSCALER_AUTOREACTIVEFLAGS_APPLY_INVERSETONEMAP)
{
ColorPreAlpha = InverseTonemap(ColorPreAlpha);
ColorPostAlpha = InverseTonemap(ColorPostAlpha);
}
float out_reactive_value = 0.f;
float3 delta = abs(ColorPostAlpha - ColorPreAlpha);
out_reactive_value = (GenReactiveFlags() & FFX_FSR3UPSCALER_AUTOREACTIVEFLAGS_USE_COMPONENTS_MAX) ? max(delta.x, max(delta.y, delta.z)) : length(delta);
out_reactive_value *= GenReactiveScale();
out_reactive_value = (GenReactiveFlags() & FFX_FSR3UPSCALER_AUTOREACTIVEFLAGS_APPLY_THRESHOLD) ? (out_reactive_value < GenReactiveThreshold() ? 0 : GenReactiveBinaryValue()) : out_reactive_value;
rw_output_autoreactive[uDispatchThreadId] = out_reactive_value;
}

2
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_depth_clip_pass.hlsl.meta → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_autogen_reactive_pass.hlsl.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 7981b48622ddaa944909ebf209284d83
guid: 52cdb7a7c30cb614984908593ed19082
ShaderIncludeImporter:
externalObjects: {}
userData:

55
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_compute_luminance_pyramid_pass.hlsl

@ -0,0 +1,55 @@
// This file is part of the FidelityFX SDK.
//
// Copyright (c) 2023 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.
#define FSR3UPSCALER_BIND_SRV_INPUT_COLOR 0
#define FSR3UPSCALER_BIND_UAV_SPD_GLOBAL_ATOMIC 0
#define FSR3UPSCALER_BIND_UAV_EXPOSURE_MIP_LUMA_CHANGE 1
#define FSR3UPSCALER_BIND_UAV_EXPOSURE_MIP_5 2
#define FSR3UPSCALER_BIND_UAV_AUTO_EXPOSURE 3
#define FSR3UPSCALER_BIND_CB_FSR3UPSCALER 0
#define FSR3UPSCALER_BIND_CB_SPD 1
#include "fsr3upscaler/ffx_fsr3upscaler_callbacks_hlsl.h"
#include "fsr3upscaler/ffx_fsr3upscaler_common.h"
#include "fsr3upscaler/ffx_fsr3upscaler_compute_luminance_pyramid.h"
#ifndef FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH
#define FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH 256
#endif // #ifndef FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH
#ifndef FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT
#define FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT 1
#endif // #ifndef FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT
#ifndef FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH
#define FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH 1
#endif // #ifndef FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH
#ifndef FFX_FSR3UPSCALER_NUM_THREADS
#define FFX_FSR3UPSCALER_NUM_THREADS [numthreads(FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH, FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT, FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH)]
#endif // #ifndef FFX_FSR3UPSCALER_NUM_THREADS
FFX_FSR3UPSCALER_NUM_THREADS
FFX_FSR3UPSCALER_EMBED_CB2_ROOTSIG_CONTENT
void CS(uint3 WorkGroupId : SV_GroupID, uint LocalThreadIndex : SV_GroupIndex)
{
ComputeAutoExposure(WorkGroupId, LocalThreadIndex);
}

2
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_accumulate_pass.hlsl.meta → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_compute_luminance_pyramid_pass.hlsl.meta

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 356ec46d3f01672428b5a7a0de727548
guid: 2d149b52ba0f5bb468a94a71dbbcb66f
ShaderIncludeImporter:
externalObjects: {}
userData:

67
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_depth_clip_pass.hlsl

@ -0,0 +1,67 @@
// This file is part of the FidelityFX SDK.
//
// Copyright (c) 2023 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.
#define FSR3UPSCALER_BIND_SRV_RECONSTRUCTED_PREV_NEAREST_DEPTH 0
#define FSR3UPSCALER_BIND_SRV_DILATED_MOTION_VECTORS 1
#define FSR3UPSCALER_BIND_SRV_DILATED_DEPTH 2
#define FSR3UPSCALER_BIND_SRV_REACTIVE_MASK 3
#define FSR3UPSCALER_BIND_SRV_TRANSPARENCY_AND_COMPOSITION_MASK 4
#define FSR3UPSCALER_BIND_SRV_PREVIOUS_DILATED_MOTION_VECTORS 5
#define FSR3UPSCALER_BIND_SRV_INPUT_MOTION_VECTORS 6
#define FSR3UPSCALER_BIND_SRV_INPUT_COLOR 7
#define FSR3UPSCALER_BIND_SRV_INPUT_DEPTH 8
#define FSR3UPSCALER_BIND_SRV_INPUT_EXPOSURE 9
#define FSR3UPSCALER_BIND_UAV_DILATED_REACTIVE_MASKS 0
#define FSR3UPSCALER_BIND_UAV_PREPARED_INPUT_COLOR 1
#define FSR3UPSCALER_BIND_CB_FSR3UPSCALER 0
#include "fsr3upscaler/ffx_fsr3upscaler_callbacks_hlsl.h"
#include "fsr3upscaler/ffx_fsr3upscaler_common.h"
#include "fsr3upscaler/ffx_fsr3upscaler_sample.h"
#include "fsr3upscaler/ffx_fsr3upscaler_depth_clip.h"
#ifndef FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH
#define FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH 8
#endif // #ifndef FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH
#ifndef FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT
#define FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT 8
#endif // #ifndef FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT
#ifndef FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH
#define FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH 1
#endif // #ifndef FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH
#ifndef FFX_FSR3UPSCALER_NUM_THREADS
#define FFX_FSR3UPSCALER_NUM_THREADS [numthreads(FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH, FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT, FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH)]
#endif // #ifndef FFX_FSR3UPSCALER_NUM_THREADS
FFX_PREFER_WAVE64
FFX_FSR3UPSCALER_NUM_THREADS
FFX_FSR3UPSCALER_EMBED_ROOTSIG_CONTENT
void CS(
int2 iGroupId : SV_GroupID,
int2 iDispatchThreadId : SV_DispatchThreadID,
int2 iGroupThreadId : SV_GroupThreadID,
int iGroupIndex : SV_GroupIndex)
{
DepthClip(iDispatchThreadId);
}

7
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_depth_clip_pass.hlsl.meta

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: da435b71cf57e2247b80ae0f0f86d1f8
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

56
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_lock_pass.hlsl

@ -0,0 +1,56 @@
// This file is part of the FidelityFX SDK.
//
// Copyright (c) 2023 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.
#define FSR3UPSCALER_BIND_SRV_LOCK_INPUT_LUMA 0
#define FSR3UPSCALER_BIND_UAV_NEW_LOCKS 0
#define FSR3UPSCALER_BIND_UAV_RECONSTRUCTED_PREV_NEAREST_DEPTH 1
#define FSR3UPSCALER_BIND_CB_FSR3UPSCALER 0
#include "fsr3upscaler/ffx_fsr3upscaler_callbacks_hlsl.h"
#include "fsr3upscaler/ffx_fsr3upscaler_common.h"
#include "fsr3upscaler/ffx_fsr3upscaler_sample.h"
#include "fsr3upscaler/ffx_fsr3upscaler_lock.h"
#ifndef FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH
#define FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH 8
#endif // #ifndef FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH
#ifndef FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT
#define FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT 8
#endif // #ifndef FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT
#ifndef FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH
#define FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH 1
#endif // #ifndef FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH
#ifndef FFX_FSR3UPSCALER_NUM_THREADS
#define FFX_FSR3UPSCALER_NUM_THREADS [numthreads(FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH, FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT, FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH)]
#endif // #ifndef FFX_FSR3UPSCALER_NUM_THREADS
FFX_PREFER_WAVE64
FFX_FSR3UPSCALER_NUM_THREADS
FFX_FSR3UPSCALER_EMBED_ROOTSIG_CONTENT
void CS(uint2 uGroupId : SV_GroupID, uint2 uGroupThreadId : SV_GroupThreadID)
{
uint2 uDispatchThreadId = uGroupId * uint2(FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH, FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT) + uGroupThreadId;
ComputeLock(uDispatchThreadId);
}

7
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_lock_pass.hlsl.meta

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 98d2cbbda5e90dd4ebd1d70abbb63a09
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

53
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_rcas_pass.hlsl

@ -0,0 +1,53 @@
// This file is part of the FidelityFX SDK.
//
// Copyright (c) 2023 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.
#define FSR3UPSCALER_BIND_SRV_INPUT_EXPOSURE 0
#define FSR3UPSCALER_BIND_SRV_RCAS_INPUT 1
#define FSR3UPSCALER_BIND_UAV_UPSCALED_OUTPUT 0
#define FSR3UPSCALER_BIND_CB_FSR3UPSCALER 0
#define FSR3UPSCALER_BIND_CB_RCAS 1
#include "fsr3upscaler/ffx_fsr3upscaler_callbacks_hlsl.h"
#include "fsr3upscaler/ffx_fsr3upscaler_common.h"
#include "fsr3upscaler/ffx_fsr3upscaler_rcas.h"
#ifndef FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH
#define FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH 64
#endif // #ifndef FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH
#ifndef FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT
#define FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT 1
#endif // #ifndef FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT
#ifndef FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH
#define FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH 1
#endif // #ifndef FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH
#ifndef FFX_FSR3UPSCALER_NUM_THREADS
#define FFX_FSR3UPSCALER_NUM_THREADS [numthreads(FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH, FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT, FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH)]
#endif // #ifndef FFX_FSR3UPSCALER_NUM_THREADS
FFX_FSR3UPSCALER_NUM_THREADS
FFX_FSR3UPSCALER_EMBED_CB2_ROOTSIG_CONTENT
void CS(uint3 LocalThreadId : SV_GroupThreadID, uint3 WorkGroupId : SV_GroupID, uint3 Dtid : SV_DispatchThreadID)
{
RCAS(LocalThreadId, WorkGroupId, Dtid);
}

7
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_rcas_pass.hlsl.meta

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9a15fc73170a9bc478801c8fa4d8d574
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

64
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_reconstruct_previous_depth_pass.hlsl

@ -0,0 +1,64 @@
// This file is part of the FidelityFX SDK.
//
// Copyright (c) 2023 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.
#define FSR3UPSCALER_BIND_SRV_INPUT_MOTION_VECTORS 0
#define FSR3UPSCALER_BIND_SRV_INPUT_DEPTH 1
#define FSR3UPSCALER_BIND_SRV_INPUT_COLOR 2
#define FSR3UPSCALER_BIND_SRV_INPUT_EXPOSURE 3
#define FSR3UPSCALER_BIND_UAV_RECONSTRUCTED_PREV_NEAREST_DEPTH 0
#define FSR3UPSCALER_BIND_UAV_DILATED_MOTION_VECTORS 1
#define FSR3UPSCALER_BIND_UAV_DILATED_DEPTH 2
#define FSR3UPSCALER_BIND_UAV_LOCK_INPUT_LUMA 3
#define FSR3UPSCALER_BIND_CB_FSR3UPSCALER 0
#include "fsr3upscaler/ffx_fsr3upscaler_callbacks_hlsl.h"
#include "fsr3upscaler/ffx_fsr3upscaler_common.h"
#include "fsr3upscaler/ffx_fsr3upscaler_sample.h"
#include "fsr3upscaler/ffx_fsr3upscaler_reconstruct_dilated_velocity_and_previous_depth.h"
#ifndef FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH
#define FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH 8
#endif // #ifndef FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH
#ifndef FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT
#define FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT 8
#endif // #ifndef FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT
#ifndef FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH
#define FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH 1
#endif // #ifndef FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH
#ifndef FFX_FSR3UPSCALER_NUM_THREADS
#define FFX_FSR3UPSCALER_NUM_THREADS [numthreads(FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH, FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT, FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH)]
#endif // #ifndef FFX_FSR3UPSCALER_NUM_THREADS
FFX_PREFER_WAVE64
FFX_FSR3UPSCALER_NUM_THREADS
FFX_FSR3UPSCALER_EMBED_ROOTSIG_CONTENT
void CS(
int2 iGroupId : SV_GroupID,
int2 iDispatchThreadId : SV_DispatchThreadID,
int2 iGroupThreadId : SV_GroupThreadID,
int iGroupIndex : SV_GroupIndex
)
{
ReconstructAndDilate(iDispatchThreadId);
}

7
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_reconstruct_previous_depth_pass.hlsl.meta

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: bafb3726a76b97a49bb343d8a4323754
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

96
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR2/shaders/ffx_fsr2_tcr_autogen_pass.hlsl → Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_tcr_autogen_pass.hlsl

@ -19,68 +19,44 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#define FSR2_BIND_SRV_INPUT_OPAQUE_ONLY 0
#define FSR2_BIND_SRV_INPUT_COLOR 1
#define FSR2_BIND_SRV_INPUT_MOTION_VECTORS 2
#define FSR2_BIND_SRV_PREV_PRE_ALPHA_COLOR 3
#define FSR2_BIND_SRV_PREV_POST_ALPHA_COLOR 4
#define FSR2_BIND_SRV_REACTIVE_MASK 4
#define FSR2_BIND_SRV_TRANSPARENCY_AND_COMPOSITION_MASK 5
#define FSR2_BIND_UAV_AUTOREACTIVE 0
#define FSR2_BIND_UAV_AUTOCOMPOSITION 1
#define FSR2_BIND_UAV_PREV_PRE_ALPHA_COLOR 2
#define FSR2_BIND_UAV_PREV_POST_ALPHA_COLOR 3
#define FSR2_BIND_CB_FSR2 0
#define FSR2_BIND_CB_AUTOREACTIVE 1
#include "ffx_fsr2_callbacks_hlsl.h"
#include "ffx_fsr2_common.h"
#if defined(FSR2_BIND_CB_AUTOREACTIVE)
cbuffer cbGenerateReactive : FFX_FSR2_DECLARE_CB(FSR2_BIND_CB_AUTOREACTIVE)
{
float fTcThreshold; // 0.1 is a good starting value, lower will result in more TC pixels
float fTcScale;
float fReactiveScale;
float fReactiveMax;
};
float getTcThreshold()
{
return fTcThreshold;
}
#else
#define fTcThreshold 0.05f
#define fTcScale 1.00f
#define fReactiveScale 10.0f
#define fReactiveMax 0.90f
float getTcThreshold()
{
return fTcThreshold;
}
#endif
#include "ffx_fsr2_tcr_autogen.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 // 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
#define FSR3UPSCALER_BIND_SRV_INPUT_OPAQUE_ONLY 0
#define FSR3UPSCALER_BIND_SRV_INPUT_COLOR 1
#define FSR3UPSCALER_BIND_SRV_INPUT_MOTION_VECTORS 2
#define FSR3UPSCALER_BIND_SRV_PREV_PRE_ALPHA_COLOR 3
#define FSR3UPSCALER_BIND_SRV_PREV_POST_ALPHA_COLOR 4
#define FSR3UPSCALER_BIND_SRV_REACTIVE_MASK 4
#define FSR3UPSCALER_BIND_SRV_TRANSPARENCY_AND_COMPOSITION_MASK 5
#define FSR3UPSCALER_BIND_UAV_AUTOREACTIVE 0
#define FSR3UPSCALER_BIND_UAV_AUTOCOMPOSITION 1
#define FSR3UPSCALER_BIND_UAV_PREV_PRE_ALPHA_COLOR 2
#define FSR3UPSCALER_BIND_UAV_PREV_POST_ALPHA_COLOR 3
#define FSR3UPSCALER_BIND_CB_FSR3UPSCALER 0
#define FSR3UPSCALER_BIND_CB_AUTOREACTIVE 1
#include "fsr3upscaler/ffx_fsr3upscaler_callbacks_hlsl.h"
#include "fsr3upscaler/ffx_fsr3upscaler_common.h"
#include "fsr3upscaler/ffx_fsr3upscaler_tcr_autogen.h"
#ifndef FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH
#define FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH 8
#endif // #ifndef FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH
#ifndef FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT
#define FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT 8
#endif // FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT
#ifndef FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH
#define FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH 1
#endif // #ifndef FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH
#ifndef FFX_FSR3UPSCALER_NUM_THREADS
#define FFX_FSR3UPSCALER_NUM_THREADS [numthreads(FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH, FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT, FFX_FSR3UPSCALER_THREAD_GROUP_DEPTH)]
#endif // #ifndef FFX_FSR3UPSCALER_NUM_THREADS
FFX_FSR3UPSCALER_NUM_THREADS
FFX_FSR3UPSCALER_EMBED_ROOTSIG_CONTENT
void CS(uint2 uGroupId : SV_GroupID, uint2 uGroupThreadId : SV_GroupThreadID)
{
FFX_MIN16_I2 uDispatchThreadId = FFX_MIN16_I2(uGroupId * uint2(FFX_FSR2_THREAD_GROUP_WIDTH, FFX_FSR2_THREAD_GROUP_HEIGHT) + uGroupThreadId);
FFX_MIN16_I2 uDispatchThreadId = FFX_MIN16_I2(uGroupId * uint2(FFX_FSR3UPSCALER_THREAD_GROUP_WIDTH, FFX_FSR3UPSCALER_THREAD_GROUP_HEIGHT) + uGroupThreadId);
// ToDo: take into account jitter (i.e. add delta of previous jitter and current jitter to previous UV
// fetch pre- and post-alpha color values

7
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/FSR3/shaders/ffx_fsr3upscaler_tcr_autogen_pass.hlsl.meta

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 712d171118b59fc4fb28d0d487060d42
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save