Browse Source

Merge branch 'ww1dev/hdrp17/svn' into ww1dev/hdrp17/staging

ww1dev/hdrp17/staging
Nico de Poel 9 months ago
parent
commit
eea959c801
  1. 77
      Packages/com.unity.render-pipelines.core/Runtime/RenderPipelineResources/Default Lens Flare (SRP).asset
  2. 2
      Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs
  3. 94
      Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Upscalers/FSR/Runtime/FSR2/Fsr2Context.cs
  4. 9
      Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Upscalers/FSR/Runtime/FSR3/Fsr3UpscalerContext.cs
  5. 5
      Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Upscalers/FSR/Runtime/FSR3/Fsr3UpscalerPass.cs
  6. 7
      Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Upscalers/FSR/Runtime/FSR3/Fsr3UpscalerResources.cs
  7. 3
      Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Upscalers/FSR/Shaders/shaders/ffx_fsr3upscaler_luma_pyramid_pass.hlsl
  8. 8
      Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Upscalers/FSR/Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_accumulate.h
  9. 4
      Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Upscalers/FSR/Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_luma_pyramid.h
  10. 20
      Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Upscalers/FSR2UpscalerPlugin.cs
  11. 159
      Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Upscalers/FSR3UpscalerPlugin.cs
  12. 26
      Packages/com.unity.ugui/Tests/Editor/TMP/Unity.TextMeshPro.Editor.Tests.asmdef
  13. 2
      Packages/com.unity.ugui/Tests/Editor/UGUI/UI/PropertyDrawers/PropertyDrawerTests.cs
  14. 24
      Packages/com.unity.ugui/Tests/Editor/UGUI/UnityEditor.UI.EditorTests.asmdef
  15. 26
      Packages/com.unity.ugui/Tests/Runtime/TMP/Unity.TextMeshPro.Tests.asmdef
  16. 6
      Packages/com.unity.ugui/Tests/Runtime/UGUI/UnityEngine.UI.Tests.asmdef

77
Packages/com.unity.render-pipelines.core/Runtime/RenderPipelineResources/Default Lens Flare (SRP).asset

@ -19,6 +19,13 @@ MonoBehaviour:
positionOffset: {x: 0, y: 0} positionOffset: {x: 0, y: 0}
angularOffset: 0 angularOffset: 0
translationScale: {x: 1, y: 1} translationScale: {x: 1, y: 1}
ringThickness: 0.25
hoopFactor: 1
noiseAmplitude: 1
noiseFrequency: 1
noiseSpeed: 0
shapeCutOffSpeed: 0
shapeCutOffRadius: 10
m_LocalIntensity: 1 m_LocalIntensity: 1
lensFlareTexture: {fileID: 0} lensFlareTexture: {fileID: 0}
uniformScale: 15 uniformScale: 15
@ -27,9 +34,9 @@ MonoBehaviour:
m_Count: 5 m_Count: 5
preserveAspectRatio: 0 preserveAspectRatio: 0
rotation: 0 rotation: 0
tintConst: 1
tintColorType: 0
tint: {r: 1, g: 1, b: 1, a: 0.5} tint: {r: 1, g: 1, b: 1, a: 0.5}
tintRadial:
tintGradient:
<textureSize>k__BackingField: 4 <textureSize>k__BackingField: 4
m_Gradient: m_Gradient:
serializedVersion: 2 serializedVersion: 2
@ -216,6 +223,13 @@ MonoBehaviour:
positionOffset: {x: 0, y: 0} positionOffset: {x: 0, y: 0}
angularOffset: 0 angularOffset: 0
translationScale: {x: 1, y: 1} translationScale: {x: 1, y: 1}
ringThickness: 0.25
hoopFactor: 1
noiseAmplitude: 1
noiseFrequency: 1
noiseSpeed: 0
shapeCutOffSpeed: 0
shapeCutOffRadius: 10
m_LocalIntensity: 0.05 m_LocalIntensity: 0.05
lensFlareTexture: {fileID: 2800000, guid: da47326d6c6190a4e8793de9a26bf176, type: 3} lensFlareTexture: {fileID: 2800000, guid: da47326d6c6190a4e8793de9a26bf176, type: 3}
uniformScale: 0.3 uniformScale: 0.3
@ -224,9 +238,9 @@ MonoBehaviour:
m_Count: 5 m_Count: 5
preserveAspectRatio: 0 preserveAspectRatio: 0
rotation: 0 rotation: 0
tintConst: 1
tintColorType: 0
tint: {r: 0.49673662, g: 0.8679245, b: 0.55442125, a: 0.5} tint: {r: 0.49673662, g: 0.8679245, b: 0.55442125, a: 0.5}
tintRadial:
tintGradient:
<textureSize>k__BackingField: 4 <textureSize>k__BackingField: 4
m_Gradient: m_Gradient:
serializedVersion: 2 serializedVersion: 2
@ -431,6 +445,13 @@ MonoBehaviour:
positionOffset: {x: 0, y: 0} positionOffset: {x: 0, y: 0}
angularOffset: 0 angularOffset: 0
translationScale: {x: 1, y: 1} translationScale: {x: 1, y: 1}
ringThickness: 0.25
hoopFactor: 1
noiseAmplitude: 1
noiseFrequency: 1
noiseSpeed: 0
shapeCutOffSpeed: 0
shapeCutOffRadius: 10
m_LocalIntensity: 0.1 m_LocalIntensity: 0.1
lensFlareTexture: {fileID: 2800000, guid: da47326d6c6190a4e8793de9a26bf176, type: 3} lensFlareTexture: {fileID: 2800000, guid: da47326d6c6190a4e8793de9a26bf176, type: 3}
uniformScale: 0.35 uniformScale: 0.35
@ -439,9 +460,9 @@ MonoBehaviour:
m_Count: 4 m_Count: 4
preserveAspectRatio: 0 preserveAspectRatio: 0
rotation: 0 rotation: 0
tintConst: 1
tintColorType: 0
tint: {r: 0.9245283, g: 0.6026995, b: 0.5552984, a: 0.5} tint: {r: 0.9245283, g: 0.6026995, b: 0.5552984, a: 0.5}
tintRadial:
tintGradient:
<textureSize>k__BackingField: 4 <textureSize>k__BackingField: 4
m_Gradient: m_Gradient:
serializedVersion: 2 serializedVersion: 2
@ -655,6 +676,13 @@ MonoBehaviour:
positionOffset: {x: 0, y: 0} positionOffset: {x: 0, y: 0}
angularOffset: 0 angularOffset: 0
translationScale: {x: 1, y: 1} translationScale: {x: 1, y: 1}
ringThickness: 0.25
hoopFactor: 1
noiseAmplitude: 1
noiseFrequency: 1
noiseSpeed: 0
shapeCutOffSpeed: 0
shapeCutOffRadius: 10
m_LocalIntensity: 0.1 m_LocalIntensity: 0.1
lensFlareTexture: {fileID: 2800000, guid: da47326d6c6190a4e8793de9a26bf176, type: 3} lensFlareTexture: {fileID: 2800000, guid: da47326d6c6190a4e8793de9a26bf176, type: 3}
uniformScale: 0.3 uniformScale: 0.3
@ -663,9 +691,9 @@ MonoBehaviour:
m_Count: 2 m_Count: 2
preserveAspectRatio: 0 preserveAspectRatio: 0
rotation: 0 rotation: 0
tintConst: 1
tintColorType: 0
tint: {r: 0.9245283, g: 0.6026995, b: 0.5552984, a: 0.5} tint: {r: 0.9245283, g: 0.6026995, b: 0.5552984, a: 0.5}
tintRadial:
tintGradient:
<textureSize>k__BackingField: 4 <textureSize>k__BackingField: 4
m_Gradient: m_Gradient:
serializedVersion: 2 serializedVersion: 2
@ -852,6 +880,13 @@ MonoBehaviour:
positionOffset: {x: 0, y: 0} positionOffset: {x: 0, y: 0}
angularOffset: 0 angularOffset: 0
translationScale: {x: 1, y: 1} translationScale: {x: 1, y: 1}
ringThickness: 0.25
hoopFactor: 1
noiseAmplitude: 1
noiseFrequency: 1
noiseSpeed: 0
shapeCutOffSpeed: 0
shapeCutOffRadius: 10
m_LocalIntensity: 0.03 m_LocalIntensity: 0.03
lensFlareTexture: {fileID: 2800000, guid: da47326d6c6190a4e8793de9a26bf176, type: 3} lensFlareTexture: {fileID: 2800000, guid: da47326d6c6190a4e8793de9a26bf176, type: 3}
uniformScale: 1.5 uniformScale: 1.5
@ -860,9 +895,9 @@ MonoBehaviour:
m_Count: 4 m_Count: 4
preserveAspectRatio: 0 preserveAspectRatio: 0
rotation: 0 rotation: 0
tintConst: 1
tintColorType: 0
tint: {r: 0.34509802, g: 0.65088975, b: 1, a: 0.5} tint: {r: 0.34509802, g: 0.65088975, b: 1, a: 0.5}
tintRadial:
tintGradient:
<textureSize>k__BackingField: 4 <textureSize>k__BackingField: 4
m_Gradient: m_Gradient:
serializedVersion: 2 serializedVersion: 2
@ -1049,6 +1084,13 @@ MonoBehaviour:
positionOffset: {x: 0, y: 0} positionOffset: {x: 0, y: 0}
angularOffset: 2 angularOffset: 2
translationScale: {x: 1, y: 1} translationScale: {x: 1, y: 1}
ringThickness: 0.25
hoopFactor: 1
noiseAmplitude: 1
noiseFrequency: 1
noiseSpeed: 0
shapeCutOffSpeed: 0
shapeCutOffRadius: 10
m_LocalIntensity: 0.015 m_LocalIntensity: 0.015
lensFlareTexture: {fileID: 2800000, guid: da47326d6c6190a4e8793de9a26bf176, type: 3} lensFlareTexture: {fileID: 2800000, guid: da47326d6c6190a4e8793de9a26bf176, type: 3}
uniformScale: 2 uniformScale: 2
@ -1057,9 +1099,9 @@ MonoBehaviour:
m_Count: 3 m_Count: 3
preserveAspectRatio: 0 preserveAspectRatio: 0
rotation: 0 rotation: 0
tintConst: 1
tintColorType: 0
tint: {r: 0.34509802, g: 1, b: 0.7484353, a: 0.5} tint: {r: 0.34509802, g: 1, b: 0.7484353, a: 0.5}
tintRadial:
tintGradient:
<textureSize>k__BackingField: 4 <textureSize>k__BackingField: 4
m_Gradient: m_Gradient:
serializedVersion: 2 serializedVersion: 2
@ -1246,6 +1288,13 @@ MonoBehaviour:
positionOffset: {x: 0, y: 0} positionOffset: {x: 0, y: 0}
angularOffset: 0 angularOffset: 0
translationScale: {x: 1, y: 1} translationScale: {x: 1, y: 1}
ringThickness: 0.25
hoopFactor: 1
noiseAmplitude: 1
noiseFrequency: 1
noiseSpeed: 0
shapeCutOffSpeed: 0
shapeCutOffRadius: 10
m_LocalIntensity: 0.008 m_LocalIntensity: 0.008
lensFlareTexture: {fileID: 2800000, guid: da47326d6c6190a4e8793de9a26bf176, type: 3} lensFlareTexture: {fileID: 2800000, guid: da47326d6c6190a4e8793de9a26bf176, type: 3}
uniformScale: 2 uniformScale: 2
@ -1254,9 +1303,9 @@ MonoBehaviour:
m_Count: 3 m_Count: 3
preserveAspectRatio: 0 preserveAspectRatio: 0
rotation: 0 rotation: 0
tintConst: 1
tintColorType: 0
tint: {r: 0.34509802, g: 1, b: 0.7484353, a: 0.5} tint: {r: 0.34509802, g: 1, b: 0.7484353, a: 0.5}
tintRadial:
tintGradient:
<textureSize>k__BackingField: 4 <textureSize>k__BackingField: 4
m_Gradient: m_Gradient:
serializedVersion: 2 serializedVersion: 2

2
Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs

@ -2461,7 +2461,7 @@ namespace UnityEngine.Rendering.HighDefinition
name: string.Format("{0}_CameraColorBufferMipChain{1}", viewName, frameIndex)); name: string.Format("{0}_CameraColorBufferMipChain{1}", viewName, frameIndex));
} }
void ReleaseHistoryBuffer()
public void ReleaseHistoryBuffer() //WW1MOD : Make public
{ {
m_HistoryRTSystem.ReleaseAll(); m_HistoryRTSystem.ReleaseAll();

94
Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Upscalers/FSR/Runtime/FSR2/Fsr2Context.cs

@ -34,10 +34,10 @@ namespace FidelityFX.FSR2
public class Fsr2Context public class Fsr2Context
{ {
private const int MaxQueuedFrames = 16; private const int MaxQueuedFrames = 16;
private Fsr2.ContextDescription _contextDescription; private Fsr2.ContextDescription _contextDescription;
private CommandBuffer _commandBuffer; private CommandBuffer _commandBuffer;
private Fsr2Pass _computeLuminancePyramidPass; private Fsr2Pass _computeLuminancePyramidPass;
private Fsr2Pass _reconstructPreviousDepthPass; private Fsr2Pass _reconstructPreviousDepthPass;
private Fsr2Pass _depthClipPass; private Fsr2Pass _depthClipPass;
@ -56,7 +56,7 @@ namespace FidelityFX.FSR2
private ComputeBuffer _spdConstantsBuffer; private ComputeBuffer _spdConstantsBuffer;
private readonly Fsr2.SpdConstants[] _spdConstantsArray = { new Fsr2.SpdConstants() }; private readonly Fsr2.SpdConstants[] _spdConstantsArray = { new Fsr2.SpdConstants() };
private ref Fsr2.SpdConstants SpdConsts => ref _spdConstantsArray[0]; private ref Fsr2.SpdConstants SpdConsts => ref _spdConstantsArray[0];
private ComputeBuffer _rcasConstantsBuffer; private ComputeBuffer _rcasConstantsBuffer;
private readonly Fsr2.RcasConstants[] _rcasConstantsArray = new Fsr2.RcasConstants[1]; private readonly Fsr2.RcasConstants[] _rcasConstantsArray = new Fsr2.RcasConstants[1];
private ref Fsr2.RcasConstants RcasConsts => ref _rcasConstantsArray[0]; private ref Fsr2.RcasConstants RcasConsts => ref _rcasConstantsArray[0];
@ -77,7 +77,7 @@ namespace FidelityFX.FSR2
{ {
_contextDescription = contextDescription; _contextDescription = contextDescription;
_commandBuffer = new CommandBuffer { name = "FSR2" }; _commandBuffer = new CommandBuffer { name = "FSR2" };
_upscalerConstantsBuffer = CreateConstantBuffer<Fsr2.UpscalerConstants>(); _upscalerConstantsBuffer = CreateConstantBuffer<Fsr2.UpscalerConstants>();
_spdConstantsBuffer = CreateConstantBuffer<Fsr2.SpdConstants>(); _spdConstantsBuffer = CreateConstantBuffer<Fsr2.SpdConstants>();
_rcasConstantsBuffer = CreateConstantBuffer<Fsr2.RcasConstants>(); _rcasConstantsBuffer = CreateConstantBuffer<Fsr2.RcasConstants>();
@ -87,9 +87,9 @@ namespace FidelityFX.FSR2
// Set defaults // Set defaults
_firstExecution = true; _firstExecution = true;
_resourceFrameIndex = 0; _resourceFrameIndex = 0;
UpscalerConsts.displaySize = _contextDescription.DisplaySize; UpscalerConsts.displaySize = _contextDescription.DisplaySize;
_resources.Create(_contextDescription); _resources.Create(_contextDescription);
CreatePasses(); CreatePasses();
} }
@ -105,7 +105,7 @@ namespace FidelityFX.FSR2
_generateReactivePass = new Fsr2GenerateReactivePass(_contextDescription, _resources, _generateReactiveConstantsBuffer); _generateReactivePass = new Fsr2GenerateReactivePass(_contextDescription, _resources, _generateReactiveConstantsBuffer);
_tcrAutogeneratePass = new Fsr2TcrAutogeneratePass(_contextDescription, _resources, _upscalerConstantsBuffer, _tcrAutogenerateConstantsBuffer); _tcrAutogeneratePass = new Fsr2TcrAutogeneratePass(_contextDescription, _resources, _upscalerConstantsBuffer, _tcrAutogenerateConstantsBuffer);
} }
public void Destroy() public void Destroy()
{ {
DestroyPass(ref _tcrAutogeneratePass); DestroyPass(ref _tcrAutogeneratePass);
@ -116,9 +116,9 @@ namespace FidelityFX.FSR2
DestroyPass(ref _depthClipPass); DestroyPass(ref _depthClipPass);
DestroyPass(ref _reconstructPreviousDepthPass); DestroyPass(ref _reconstructPreviousDepthPass);
DestroyPass(ref _computeLuminancePyramidPass); DestroyPass(ref _computeLuminancePyramidPass);
_resources.Destroy(); _resources.Destroy();
DestroyConstantBuffer(ref _tcrAutogenerateConstantsBuffer); DestroyConstantBuffer(ref _tcrAutogenerateConstantsBuffer);
DestroyConstantBuffer(ref _generateReactiveConstantsBuffer); DestroyConstantBuffer(ref _generateReactiveConstantsBuffer);
DestroyConstantBuffer(ref _rcasConstantsBuffer); DestroyConstantBuffer(ref _rcasConstantsBuffer);
@ -138,17 +138,17 @@ namespace FidelityFX.FSR2
Dispatch(dispatchParams, _commandBuffer); Dispatch(dispatchParams, _commandBuffer);
Graphics.ExecuteCommandBuffer(_commandBuffer); Graphics.ExecuteCommandBuffer(_commandBuffer);
} }
public void Dispatch(Fsr2.DispatchDescription dispatchParams, CommandBuffer commandBuffer) public void Dispatch(Fsr2.DispatchDescription dispatchParams, CommandBuffer commandBuffer)
{ {
if ((_contextDescription.Flags & Fsr2.InitializationFlags.EnableDebugChecking) != 0) if ((_contextDescription.Flags & Fsr2.InitializationFlags.EnableDebugChecking) != 0)
{ {
DebugCheckDispatch(dispatchParams); DebugCheckDispatch(dispatchParams);
} }
if (dispatchParams.UseTextureArrays) if (dispatchParams.UseTextureArrays)
commandBuffer.EnableShaderKeyword("UNITY_FSR_TEXTURE2D_X_ARRAY"); commandBuffer.EnableShaderKeyword("UNITY_FSR_TEXTURE2D_X_ARRAY");
if (_firstExecution) if (_firstExecution)
{ {
commandBuffer.SetRenderTarget(_resources.LockStatus[0]); commandBuffer.SetRenderTarget(_resources.LockStatus[0]);
@ -156,7 +156,7 @@ namespace FidelityFX.FSR2
commandBuffer.SetRenderTarget(_resources.LockStatus[1]); commandBuffer.SetRenderTarget(_resources.LockStatus[1]);
commandBuffer.ClearRenderTarget(false, true, Color.clear); commandBuffer.ClearRenderTarget(false, true, Color.clear);
} }
int frameIndex = _resourceFrameIndex % 2; int frameIndex = _resourceFrameIndex % 2;
bool resetAccumulation = dispatchParams.Reset || _firstExecution; bool resetAccumulation = dispatchParams.Reset || _firstExecution;
_firstExecution = false; _firstExecution = false;
@ -164,7 +164,7 @@ namespace FidelityFX.FSR2
// If auto exposure is enabled use the auto exposure SRV, otherwise what the app sends // If auto exposure is enabled use the auto exposure SRV, otherwise what the app sends
if ((_contextDescription.Flags & Fsr2.InitializationFlags.EnableAutoExposure) != 0) if ((_contextDescription.Flags & Fsr2.InitializationFlags.EnableAutoExposure) != 0)
dispatchParams.Exposure = new ResourceView(_resources.AutoExposure); dispatchParams.Exposure = new ResourceView(_resources.AutoExposure);
else if (!dispatchParams.Exposure.IsValid)
else if (!dispatchParams.Exposure.IsValid)
dispatchParams.Exposure = new ResourceView(_resources.DefaultExposure); dispatchParams.Exposure = new ResourceView(_resources.DefaultExposure);
if (dispatchParams.EnableAutoReactive) if (dispatchParams.EnableAutoReactive)
@ -181,16 +181,16 @@ namespace FidelityFX.FSR2
} }
else if (_resources.AutoReactive != null) else if (_resources.AutoReactive != null)
{ {
// Destroy the auto-TCR resources if we don't use the feature
// Destroy the auto-TCR resources if we don't use the feature
_resources.DestroyTcrAutogenResources(); _resources.DestroyTcrAutogenResources();
} }
if (!dispatchParams.Reactive.IsValid) dispatchParams.Reactive = new ResourceView(_resources.DefaultReactive); if (!dispatchParams.Reactive.IsValid) dispatchParams.Reactive = new ResourceView(_resources.DefaultReactive);
if (!dispatchParams.TransparencyAndComposition.IsValid) dispatchParams.TransparencyAndComposition = new ResourceView(_resources.DefaultReactive); if (!dispatchParams.TransparencyAndComposition.IsValid) dispatchParams.TransparencyAndComposition = new ResourceView(_resources.DefaultReactive);
Fsr2Resources.CreateAliasableResources(commandBuffer, _contextDescription, dispatchParams); Fsr2Resources.CreateAliasableResources(commandBuffer, _contextDescription, dispatchParams);
SetupConstants(dispatchParams, resetAccumulation); SetupConstants(dispatchParams, resetAccumulation);
// Reactive mask bias // Reactive mask bias
const int threadGroupWorkRegionDim = 8; const int threadGroupWorkRegionDim = 8;
int dispatchSrcX = (UpscalerConsts.renderSize.x + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim; int dispatchSrcX = (UpscalerConsts.renderSize.x + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim;
@ -203,7 +203,7 @@ namespace FidelityFX.FSR2
{ {
commandBuffer.SetRenderTarget(_resources.LockStatus[frameIndex ^ 1]); commandBuffer.SetRenderTarget(_resources.LockStatus[frameIndex ^ 1]);
commandBuffer.ClearRenderTarget(false, true, Color.clear); commandBuffer.ClearRenderTarget(false, true, Color.clear);
commandBuffer.SetRenderTarget(_resources.InternalUpscaled[frameIndex ^ 1]); commandBuffer.SetRenderTarget(_resources.InternalUpscaled[frameIndex ^ 1]);
commandBuffer.ClearRenderTarget(false, true, Color.clear); commandBuffer.ClearRenderTarget(false, true, Color.clear);
@ -213,7 +213,7 @@ namespace FidelityFX.FSR2
commandBuffer.SetRenderTarget(_resources.SceneLuminance); commandBuffer.SetRenderTarget(_resources.SceneLuminance);
commandBuffer.ClearRenderTarget(false, true, Color.clear); commandBuffer.ClearRenderTarget(false, true, Color.clear);
// Auto exposure always used to track luma changes in locking logic // Auto exposure always used to track luma changes in locking logic
commandBuffer.SetRenderTarget(_resources.AutoExposure); commandBuffer.SetRenderTarget(_resources.AutoExposure);
commandBuffer.ClearRenderTarget(false, true, new Color(0f, 1f, 0f, 0f)); commandBuffer.ClearRenderTarget(false, true, new Color(0f, 1f, 0f, 0f));
@ -222,15 +222,15 @@ namespace FidelityFX.FSR2
commandBuffer.SetRenderTarget(_resources.SpdAtomicCounter); commandBuffer.SetRenderTarget(_resources.SpdAtomicCounter);
commandBuffer.ClearRenderTarget(false, true, Color.clear); 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 // 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 & Fsr2.InitializationFlags.EnableDepthInverted) == Fsr2.InitializationFlags.EnableDepthInverted; bool depthInverted = (_contextDescription.Flags & Fsr2.InitializationFlags.EnableDepthInverted) == Fsr2.InitializationFlags.EnableDepthInverted;
commandBuffer.SetRenderTarget(Fsr2ShaderIDs.UavReconstructedPrevNearestDepth); commandBuffer.SetRenderTarget(Fsr2ShaderIDs.UavReconstructedPrevNearestDepth);
commandBuffer.ClearRenderTarget(false, true, depthInverted ? Color.clear : Color.white); commandBuffer.ClearRenderTarget(false, true, depthInverted ? Color.clear : Color.white);
// Auto exposure // Auto exposure
SetupSpdConstants(dispatchParams, out var dispatchThreadGroupCount); SetupSpdConstants(dispatchParams, out var dispatchThreadGroupCount);
// Initialize constant buffers data // Initialize constant buffers data
commandBuffer.SetBufferData(_upscalerConstantsBuffer, _upscalerConstantsArray); commandBuffer.SetBufferData(_upscalerConstantsBuffer, _upscalerConstantsArray);
commandBuffer.SetBufferData(_spdConstantsBuffer, _spdConstantsArray); commandBuffer.SetBufferData(_spdConstantsBuffer, _spdConstantsArray);
@ -242,7 +242,7 @@ namespace FidelityFX.FSR2
dispatchParams.Reactive = new ResourceView(_resources.AutoReactive); dispatchParams.Reactive = new ResourceView(_resources.AutoReactive);
dispatchParams.TransparencyAndComposition = new ResourceView(_resources.AutoComposition); dispatchParams.TransparencyAndComposition = new ResourceView(_resources.AutoComposition);
} }
// Compute luminance pyramid // Compute luminance pyramid
_computeLuminancePyramidPass.ScheduleDispatch(commandBuffer, dispatchParams, frameIndex, dispatchThreadGroupCount.x, dispatchThreadGroupCount.y); _computeLuminancePyramidPass.ScheduleDispatch(commandBuffer, dispatchParams, frameIndex, dispatchThreadGroupCount.x, dispatchThreadGroupCount.y);
@ -263,18 +263,18 @@ namespace FidelityFX.FSR2
// Compute the constants // Compute the constants
SetupRcasConstants(dispatchParams); SetupRcasConstants(dispatchParams);
commandBuffer.SetBufferData(_rcasConstantsBuffer, _rcasConstantsArray); commandBuffer.SetBufferData(_rcasConstantsBuffer, _rcasConstantsArray);
// Dispatch RCAS // Dispatch RCAS
const int threadGroupWorkRegionDimRcas = 16; const int threadGroupWorkRegionDimRcas = 16;
int threadGroupsX = (Screen.width + threadGroupWorkRegionDimRcas - 1) / threadGroupWorkRegionDimRcas;
int threadGroupsY = (Screen.height + threadGroupWorkRegionDimRcas - 1) / threadGroupWorkRegionDimRcas;
int threadGroupsX = (_contextDescription.DisplaySize.x + threadGroupWorkRegionDimRcas - 1) / threadGroupWorkRegionDimRcas;
int threadGroupsY = (_contextDescription.DisplaySize.y + threadGroupWorkRegionDimRcas - 1) / threadGroupWorkRegionDimRcas;
_sharpenPass.ScheduleDispatch(commandBuffer, dispatchParams, frameIndex, threadGroupsX, threadGroupsY); _sharpenPass.ScheduleDispatch(commandBuffer, dispatchParams, frameIndex, threadGroupsX, threadGroupsY);
} }
_resourceFrameIndex = (_resourceFrameIndex + 1) % MaxQueuedFrames; _resourceFrameIndex = (_resourceFrameIndex + 1) % MaxQueuedFrames;
Fsr2Resources.DestroyAliasableResources(commandBuffer); Fsr2Resources.DestroyAliasableResources(commandBuffer);
commandBuffer.DisableShaderKeyword("UNITY_FSR_TEXTURE2D_X_ARRAY"); commandBuffer.DisableShaderKeyword("UNITY_FSR_TEXTURE2D_X_ARRAY");
} }
@ -296,7 +296,7 @@ namespace FidelityFX.FSR2
GenReactiveConsts.binaryValue = dispatchParams.BinaryValue; GenReactiveConsts.binaryValue = dispatchParams.BinaryValue;
GenReactiveConsts.flags = (uint)dispatchParams.Flags; GenReactiveConsts.flags = (uint)dispatchParams.Flags;
commandBuffer.SetBufferData(_generateReactiveConstantsBuffer, _generateReactiveConstantsArray); commandBuffer.SetBufferData(_generateReactiveConstantsBuffer, _generateReactiveConstantsArray);
((Fsr2GenerateReactivePass)_generateReactivePass).ScheduleDispatch(commandBuffer, dispatchParams, dispatchSrcX, dispatchSrcY); ((Fsr2GenerateReactivePass)_generateReactivePass).ScheduleDispatch(commandBuffer, dispatchParams, dispatchSrcX, dispatchSrcY);
} }
@ -311,14 +311,14 @@ namespace FidelityFX.FSR2
TcrAutoGenConsts.autoReactiveScale = dispatchParams.AutoReactiveScale; TcrAutoGenConsts.autoReactiveScale = dispatchParams.AutoReactiveScale;
TcrAutoGenConsts.autoReactiveMax = dispatchParams.AutoReactiveMax; TcrAutoGenConsts.autoReactiveMax = dispatchParams.AutoReactiveMax;
commandBuffer.SetBufferData(_tcrAutogenerateConstantsBuffer, _tcrAutogenerateConstantsArray); commandBuffer.SetBufferData(_tcrAutogenerateConstantsBuffer, _tcrAutogenerateConstantsArray);
_tcrAutogeneratePass.ScheduleDispatch(commandBuffer, dispatchParams, frameIndex, dispatchSrcX, dispatchSrcY); _tcrAutogeneratePass.ScheduleDispatch(commandBuffer, dispatchParams, frameIndex, dispatchSrcX, dispatchSrcY);
} }
private void SetupConstants(Fsr2.DispatchDescription dispatchParams, bool resetAccumulation) private void SetupConstants(Fsr2.DispatchDescription dispatchParams, bool resetAccumulation)
{ {
ref Fsr2.UpscalerConstants constants = ref UpscalerConsts; ref Fsr2.UpscalerConstants constants = ref UpscalerConsts;
constants.jitterOffset = dispatchParams.JitterOffset; constants.jitterOffset = dispatchParams.JitterOffset;
constants.renderSize = dispatchParams.RenderSize; constants.renderSize = dispatchParams.RenderSize;
constants.maxRenderSize = _contextDescription.MaxRenderSize; constants.maxRenderSize = _contextDescription.MaxRenderSize;
@ -332,16 +332,16 @@ namespace FidelityFX.FSR2
// Compute params to enable device depth to view space depth computation in shader // Compute params to enable device depth to view space depth computation in shader
constants.deviceToViewDepth = SetupDeviceDepthToViewSpaceDepthParams(dispatchParams); constants.deviceToViewDepth = SetupDeviceDepthToViewSpaceDepthParams(dispatchParams);
// To be updated if resource is larger than the actual image size // To be updated if resource is larger than the actual image size
constants.downscaleFactor = new Vector2((float)constants.renderSize.x / _contextDescription.DisplaySize.x, (float)constants.renderSize.y / _contextDescription.DisplaySize.y); constants.downscaleFactor = new Vector2((float)constants.renderSize.x / _contextDescription.DisplaySize.x, (float)constants.renderSize.y / _contextDescription.DisplaySize.y);
constants.previousFramePreExposure = constants.preExposure; constants.previousFramePreExposure = constants.preExposure;
constants.preExposure = (dispatchParams.PreExposure != 0) ? dispatchParams.PreExposure : 1.0f; constants.preExposure = (dispatchParams.PreExposure != 0) ? dispatchParams.PreExposure : 1.0f;
// Motion vector data // Motion vector data
Vector2Int motionVectorsTargetSize = (_contextDescription.Flags & Fsr2.InitializationFlags.EnableDisplayResolutionMotionVectors) != 0 ? constants.displaySize : constants.renderSize; Vector2Int motionVectorsTargetSize = (_contextDescription.Flags & Fsr2.InitializationFlags.EnableDisplayResolutionMotionVectors) != 0 ? constants.displaySize : constants.renderSize;
constants.motionVectorScale = dispatchParams.MotionVectorScale / motionVectorsTargetSize; constants.motionVectorScale = dispatchParams.MotionVectorScale / motionVectorsTargetSize;
// Compute jitter cancellation // Compute jitter cancellation
if ((_contextDescription.Flags & Fsr2.InitializationFlags.EnableMotionVectorsJitterCancellation) != 0) if ((_contextDescription.Flags & Fsr2.InitializationFlags.EnableMotionVectorsJitterCancellation) != 0)
{ {
@ -362,7 +362,7 @@ namespace FidelityFX.FSR2
else if (jitterPhaseCountDelta < 0) else if (jitterPhaseCountDelta < 0)
constants.jitterPhaseCount--; constants.jitterPhaseCount--;
} }
// Convert delta time to seconds and clamp to [0, 1] // Convert delta time to seconds and clamp to [0, 1]
constants.deltaTime = Mathf.Clamp01(dispatchParams.FrameTimeDelta); constants.deltaTime = Mathf.Clamp01(dispatchParams.FrameTimeDelta);
@ -378,7 +378,7 @@ namespace FidelityFX.FSR2
constants.lumaMipDimensions.x = (int)(constants.maxRenderSize.x / mipDiv); constants.lumaMipDimensions.x = (int)(constants.maxRenderSize.x / mipDiv);
constants.lumaMipDimensions.y = (int)(constants.maxRenderSize.y / mipDiv); constants.lumaMipDimensions.y = (int)(constants.maxRenderSize.y / mipDiv);
} }
private Vector4 SetupDeviceDepthToViewSpaceDepthParams(Fsr2.DispatchDescription dispatchParams) private Vector4 SetupDeviceDepthToViewSpaceDepthParams(Fsr2.DispatchDescription dispatchParams)
{ {
bool inverted = (_contextDescription.Flags & Fsr2.InitializationFlags.EnableDepthInverted) != 0; bool inverted = (_contextDescription.Flags & Fsr2.InitializationFlags.EnableDepthInverted) != 0;
@ -399,7 +399,7 @@ namespace FidelityFX.FSR2
Vector4 matrixElemC = new Vector4(q, -1.0f - Mathf.Epsilon, q, 0.0f + Mathf.Epsilon); Vector4 matrixElemC = new Vector4(q, -1.0f - Mathf.Epsilon, q, 0.0f + Mathf.Epsilon);
Vector4 matrixElemE = new Vector4(q * min, -min - Mathf.Epsilon, q * min, max); Vector4 matrixElemE = new Vector4(q * min, -min - Mathf.Epsilon, q * min, max);
// Revert x and y coords // Revert x and y coords
float aspect = (float)dispatchParams.RenderSize.x / dispatchParams.RenderSize.y; float aspect = (float)dispatchParams.RenderSize.x / dispatchParams.RenderSize.y;
float cotHalfFovY = Mathf.Cos(0.5f * dispatchParams.CameraFovAngleVertical) / Mathf.Sin(0.5f * dispatchParams.CameraFovAngleVertical); float cotHalfFovY = Mathf.Cos(0.5f * dispatchParams.CameraFovAngleVertical) / Mathf.Sin(0.5f * dispatchParams.CameraFovAngleVertical);
@ -422,7 +422,7 @@ namespace FidelityFX.FSR2
{ {
RectInt rectInfo = new RectInt(0, 0, dispatchParams.RenderSize.x, dispatchParams.RenderSize.y); RectInt rectInfo = new RectInt(0, 0, dispatchParams.RenderSize.x, dispatchParams.RenderSize.y);
SpdSetup(rectInfo, out dispatchThreadGroupCount, out var workGroupOffset, out var numWorkGroupsAndMips); SpdSetup(rectInfo, out dispatchThreadGroupCount, out var workGroupOffset, out var numWorkGroupsAndMips);
// Downsample // Downsample
ref Fsr2.SpdConstants spdConstants = ref SpdConsts; ref Fsr2.SpdConstants spdConstants = ref SpdConsts;
spdConstants.numWorkGroups = (uint)numWorkGroupsAndMips.x; spdConstants.numWorkGroups = (uint)numWorkGroupsAndMips.x;
@ -456,22 +456,22 @@ namespace FidelityFX.FSR2
{ {
Debug.LogError("Color resource is null"); Debug.LogError("Color resource is null");
} }
if (!dispatchParams.Depth.IsValid) if (!dispatchParams.Depth.IsValid)
{ {
Debug.LogError("Depth resource is null"); Debug.LogError("Depth resource is null");
} }
if (!dispatchParams.MotionVectors.IsValid) if (!dispatchParams.MotionVectors.IsValid)
{ {
Debug.LogError("MotionVectors resource is null"); Debug.LogError("MotionVectors resource is null");
} }
if (!dispatchParams.Output.IsValid) if (!dispatchParams.Output.IsValid)
{ {
Debug.LogError("Output resource is null"); Debug.LogError("Output resource is null");
} }
if (dispatchParams.Exposure.IsValid && (_contextDescription.Flags & Fsr2.InitializationFlags.EnableAutoExposure) != 0) if (dispatchParams.Exposure.IsValid && (_contextDescription.Flags & Fsr2.InitializationFlags.EnableAutoExposure) != 0)
{ {
Debug.LogWarning("Exposure resource provided, however auto exposure flag is present"); Debug.LogWarning("Exposure resource provided, however auto exposure flag is present");
@ -529,7 +529,7 @@ namespace FidelityFX.FSR2
Debug.LogWarning("EnableDepthInfinite and EnableDepthInverted present, yet CameraNear != float.MaxValue"); Debug.LogWarning("EnableDepthInfinite and EnableDepthInverted present, yet CameraNear != float.MaxValue");
} }
} }
if (dispatchParams.CameraFar < 0.075f) if (dispatchParams.CameraFar < 0.075f)
{ {
Debug.LogWarning("EnableDepthInverted present, CameraFar value is very low which may result in depth separation artefacting"); Debug.LogWarning("EnableDepthInverted present, CameraFar value is very low which may result in depth separation artefacting");
@ -595,17 +595,17 @@ namespace FidelityFX.FSR2
new Fsr2.RcasConstants(1064229695u, 997604214u), new Fsr2.RcasConstants(1064229695u, 997604214u),
new Fsr2.RcasConstants(1065353216u, 1006648320), new Fsr2.RcasConstants(1065353216u, 1006648320),
}; };
private static ComputeBuffer CreateConstantBuffer<TConstants>() where TConstants: struct private static ComputeBuffer CreateConstantBuffer<TConstants>() where TConstants: struct
{ {
return new ComputeBuffer(1, Marshal.SizeOf<TConstants>(), ComputeBufferType.Constant); return new ComputeBuffer(1, Marshal.SizeOf<TConstants>(), ComputeBufferType.Constant);
} }
private static void DestroyConstantBuffer(ref ComputeBuffer bufferRef) private static void DestroyConstantBuffer(ref ComputeBuffer bufferRef)
{ {
if (bufferRef == null) if (bufferRef == null)
return; return;
bufferRef.Release(); bufferRef.Release();
bufferRef = null; bufferRef = null;
} }
@ -614,7 +614,7 @@ namespace FidelityFX.FSR2
{ {
if (pass == null) if (pass == null)
return; return;
pass.Dispose(); pass.Dispose();
pass = null; pass = null;
} }

9
Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Upscalers/FSR/Runtime/FSR3/Fsr3UpscalerContext.cs

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

5
Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Upscalers/FSR/Runtime/FSR3/Fsr3UpscalerPass.cs

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

7
Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Upscalers/FSR/Runtime/FSR3/Fsr3UpscalerResources.cs

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

3
Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Upscalers/FSR/Shaders/shaders/ffx_fsr3upscaler_luma_pyramid_pass.hlsl

@ -1,7 +1,7 @@
// This file is part of the FidelityFX SDK. // This file is part of the FidelityFX SDK.
// //
// Copyright (C) 2024 Advanced Micro Devices, Inc. // Copyright (C) 2024 Advanced Micro Devices, Inc.
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files(the "Software"), to deal // of this software and associated documentation files(the "Software"), to deal
// in the Software without restriction, including without limitation the rights // in the Software without restriction, including without limitation the rights
@ -22,6 +22,7 @@
#define FSR3UPSCALER_BIND_SRV_CURRENT_LUMA 0 #define FSR3UPSCALER_BIND_SRV_CURRENT_LUMA 0
#define FSR3UPSCALER_BIND_SRV_FARTHEST_DEPTH 1 #define FSR3UPSCALER_BIND_SRV_FARTHEST_DEPTH 1
#define FSR3UPSCALER_BIND_SRV_FRAME_INFO 2
#define FSR3UPSCALER_BIND_UAV_SPD_GLOBAL_ATOMIC 0 #define FSR3UPSCALER_BIND_UAV_SPD_GLOBAL_ATOMIC 0
#define FSR3UPSCALER_BIND_UAV_FRAME_INFO 1 #define FSR3UPSCALER_BIND_UAV_FRAME_INFO 1

8
Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Upscalers/FSR/Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_accumulate.h

@ -1,7 +1,7 @@
// This file is part of the FidelityFX SDK. // This file is part of the FidelityFX SDK.
// //
// Copyright (C) 2024 Advanced Micro Devices, Inc. // Copyright (C) 2024 Advanced Micro Devices, Inc.
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files(the "Software"), to deal // of this software and associated documentation files(the "Software"), to deal
// in the Software without restriction, including without limitation the rights // in the Software without restriction, including without limitation the rights
@ -52,7 +52,7 @@ void RectifyHistory(
const FfxFloat32 fReactiveFactor = ffxPow(params.fReactiveMask, 1.0f / 2.0f); const FfxFloat32 fReactiveFactor = ffxPow(params.fReactiveMask, 1.0f / 2.0f);
const FfxFloat32 fShadingChangeFactor = params.fShadingChange; const FfxFloat32 fShadingChangeFactor = params.fShadingChange;
const FfxFloat32 fBoxScaleT = ffxMax(fVecolityFactor, ffxMax(fDistanceFactor, ffxMax(fAccumulationFactor, ffxMax(fReactiveFactor, fShadingChangeFactor)))); const FfxFloat32 fBoxScaleT = ffxMax(fVecolityFactor, ffxMax(fDistanceFactor, ffxMax(fAccumulationFactor, ffxMax(fReactiveFactor, fShadingChangeFactor))));
const FfxFloat32 fBoxScale = ffxLerp(3.0f, 1.0f, fBoxScaleT); const FfxFloat32 fBoxScale = ffxLerp(3.0f, 1.0f, fBoxScaleT);
const FfxFloat32x3 fScaledBoxVec = data.clippingBox.boxVec * FfxFloat32x3(1.7f, 1.0f, 1.0f) * fBoxScale; const FfxFloat32x3 fScaledBoxVec = data.clippingBox.boxVec * FfxFloat32x3(1.7f, 1.0f, 1.0f) * fBoxScale;
@ -148,7 +148,7 @@ void Accumulate(FfxInt32x2 iPxHrPos)
if (params.bIsExistingSample && !params.bIsNewSample) { if (params.bIsExistingSample && !params.bIsNewSample) {
ReprojectHistoryColor(params, data); ReprojectHistoryColor(params, data);
} }
UpdateLockStatus(params, data); UpdateLockStatus(params, data);
ComputeBaseAccumulationWeight(params, data); ComputeBaseAccumulationWeight(params, data);
@ -169,5 +169,5 @@ void Accumulate(FfxInt32x2 iPxHrPos)
#if FFX_FSR3UPSCALER_OPTION_APPLY_SHARPENING == 0 #if FFX_FSR3UPSCALER_OPTION_APPLY_SHARPENING == 0
StoreUpscaledOutput(iPxHrPos, data.fHistoryColor); StoreUpscaledOutput(iPxHrPos, data.fHistoryColor);
#endif #endif
StoreNewLocks(iPxHrPos, 0);
//StoreNewLocks(iPxHrPos, 0);
} }

4
Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Upscalers/FSR/Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_luma_pyramid.h

@ -1,7 +1,7 @@
// This file is part of the FidelityFX SDK. // This file is part of the FidelityFX SDK.
// //
// Copyright (C) 2024 Advanced Micro Devices, Inc. // Copyright (C) 2024 Advanced Micro Devices, Inc.
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files(the "Software"), to deal // of this software and associated documentation files(the "Software"), to deal
// in the Software without restriction, including without limitation the rights // in the Software without restriction, including without limitation the rights
@ -95,7 +95,7 @@ void SpdStore(FfxInt32x2 pix, FfxFloat32x4 outValue, FfxUInt32 index, FfxUInt32
if (all(FFX_EQUAL(pix, FfxInt32x2(0, 0)))) if (all(FFX_EQUAL(pix, FfxInt32x2(0, 0))))
{ {
FfxFloat32x4 frameInfo = LoadFrameInfo();
FfxFloat32x4 frameInfo = FrameInfo();
const FfxFloat32 fSceneAvgLuma = outValue[LUMA]; const FfxFloat32 fSceneAvgLuma = outValue[LUMA];
const FfxFloat32 fPrevLogLuma = frameInfo[FRAME_INFO_LOG_LUMA]; const FfxFloat32 fPrevLogLuma = frameInfo[FRAME_INFO_LOG_LUMA];
FfxFloat32 fLogLuma = outValue[LOG_LUMA]; FfxFloat32 fLogLuma = outValue[LOG_LUMA];

20
Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Upscalers/FSR2UpscalerPlugin.cs

@ -1,6 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using FidelityFX; using FidelityFX;
using FidelityFX.FSR2; using FidelityFX.FSR2;
using UnityEngine.Experimental.Rendering;
namespace UnityEngine.Rendering.HighDefinition.AMD.FSR2 namespace UnityEngine.Rendering.HighDefinition.AMD.FSR2
{ {
@ -63,6 +64,8 @@ namespace UnityEngine.Rendering.HighDefinition.AMD.FSR2
private readonly Fsr2.DispatchDescription _dispatchDescription = new(); private readonly Fsr2.DispatchDescription _dispatchDescription = new();
private readonly FSR2CommandInitializationData _initData; private readonly FSR2CommandInitializationData _initData;
private Texture2DArray _clearTextureArray;
internal FSR2UpscalerContext(in FSR2CommandInitializationData initSettings) internal FSR2UpscalerContext(in FSR2CommandInitializationData initSettings)
{ {
_initData = initSettings; _initData = initSettings;
@ -88,21 +91,30 @@ namespace UnityEngine.Rendering.HighDefinition.AMD.FSR2
Flags = flags, Flags = flags,
Shaders = assets.shaders, Shaders = assets.shaders,
}); });
_clearTextureArray = new Texture2DArray(1, 1, TextureXR.slices, GraphicsFormat.R32G32_SFloat, TextureCreationFlags.None);
for (int i = 0; i < TextureXR.slices; ++i) _clearTextureArray.SetPixels(new[] { Color.clear, }, i);
_clearTextureArray.Apply();
} }
internal void Destroy() internal void Destroy()
{ {
CoreUtils.Destroy(_clearTextureArray);
_context.Destroy(); _context.Destroy();
} }
public override void Execute(CommandBuffer cmd, in FSR2CommandExecutionData executeData, in FSR2TextureTable textures) public override void Execute(CommandBuffer cmd, in FSR2CommandExecutionData executeData, in FSR2TextureTable textures)
{ {
bool useTextureArrays = TextureXR.useTexArray && textures.colorInput.dimension == TextureDimension.Tex2DArray;
ResourceView clearTexture = useTextureArrays ? new ResourceView(_clearTextureArray) : new ResourceView();
_dispatchDescription.Color = new ResourceView(textures.colorInput); _dispatchDescription.Color = new ResourceView(textures.colorInput);
_dispatchDescription.Depth = new ResourceView(textures.depth); _dispatchDescription.Depth = new ResourceView(textures.depth);
_dispatchDescription.MotionVectors = new ResourceView(textures.motionVectors); _dispatchDescription.MotionVectors = new ResourceView(textures.motionVectors);
_dispatchDescription.Exposure = new ResourceView(textures.exposureTexture);
_dispatchDescription.Reactive = new ResourceView(textures.biasColorMask);
_dispatchDescription.TransparencyAndComposition = new ResourceView(textures.transparencyMask);
_dispatchDescription.Exposure = textures.exposureTexture != null ? new ResourceView(textures.exposureTexture) : new ResourceView();
_dispatchDescription.Reactive = textures.biasColorMask != null ? new ResourceView(textures.biasColorMask) : clearTexture;
_dispatchDescription.TransparencyAndComposition = textures.transparencyMask != null ? new ResourceView(textures.transparencyMask) : clearTexture;
_dispatchDescription.Output = new ResourceView(textures.colorOutput); _dispatchDescription.Output = new ResourceView(textures.colorOutput);
_dispatchDescription.JitterOffset = new Vector2(executeData.jitterOffsetX, executeData.jitterOffsetY); _dispatchDescription.JitterOffset = new Vector2(executeData.jitterOffsetX, executeData.jitterOffsetY);
@ -118,7 +130,7 @@ namespace UnityEngine.Rendering.HighDefinition.AMD.FSR2
_dispatchDescription.CameraFar = executeData.cameraFar; _dispatchDescription.CameraFar = executeData.cameraFar;
_dispatchDescription.CameraFovAngleVertical = executeData.cameraFovAngleVertical; _dispatchDescription.CameraFovAngleVertical = executeData.cameraFovAngleVertical;
_dispatchDescription.ViewSpaceToMetersFactor = 1.0f; // 1 unit is 1 meter in Unity _dispatchDescription.ViewSpaceToMetersFactor = 1.0f; // 1 unit is 1 meter in Unity
_dispatchDescription.UseTextureArrays = TextureXR.useTexArray && textures.colorInput.dimension == TextureDimension.Tex2DArray;
_dispatchDescription.UseTextureArrays = useTextureArrays;
_context.Dispatch(_dispatchDescription, cmd); _context.Dispatch(_dispatchDescription, cmd);
} }

159
Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Upscalers/FSR3UpscalerPlugin.cs

@ -1,6 +1,11 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using FidelityFX; using FidelityFX;
using FidelityFX.FSR3; using FidelityFX.FSR3;
using UnityEngine.Experimental.Rendering;
#if UNITY_STANDALONE_WIN
using AMDUP = UnityEngine.AMD;
#endif
namespace UnityEngine.Rendering.HighDefinition.AMD.FSR3 namespace UnityEngine.Rendering.HighDefinition.AMD.FSR3
{ {
@ -13,6 +18,7 @@ namespace UnityEngine.Rendering.HighDefinition.AMD.FSR3
public static bool EnableDebugView { get; set; } = false; public static bool EnableDebugView { get; set; } = false;
private Fsr3UpscalerAssets _assets; private Fsr3UpscalerAssets _assets;
private bool _nativePluginLoaded;
public override string name => "FSR 3.1"; public override string name => "FSR 3.1";
@ -20,10 +26,33 @@ namespace UnityEngine.Rendering.HighDefinition.AMD.FSR3
public override bool includesSharpening => true; public override bool includesSharpening => true;
public override bool supportsAlpha => true;
public override bool supportsAlpha => !_nativePluginLoaded; // Managed Unity port has alpha upscaling built-in, the native AMD implementation doesn't
public override bool Load() public override bool Load()
{ {
// Guess we're using native plugins after all!
// On Windows with supported graphics APIs, we use a drop-in replacement for Unity's plugin that implements FSR 3.1 through AMD's upgradable FidelityFX API.
// This allows AMD's GPU driver to hijack the plugin and transparently upgrade our implementation to FSR4 on supported graphics cards!
_nativePluginLoaded = false;
#if UNITY_STANDALONE_WIN
if (!Application.isEditor && SystemInfo.operatingSystemFamily == OperatingSystemFamily.Windows && SystemInfo.graphicsDeviceType is GraphicsDeviceType.Direct3D12 or GraphicsDeviceType.Vulkan)
{
try
{
if (AMDUP.AMDUnityPlugin.IsLoaded() || AMDUP.AMDUnityPlugin.Load())
{
_nativePluginLoaded = AMDUP.GraphicsDevice.device != null || AMDUP.GraphicsDevice.CreateGraphicsDevice() != null;
if (_nativePluginLoaded)
return true;
}
}
catch (DllNotFoundException)
{
_nativePluginLoaded = false;
}
}
#endif
if (_assets != null) if (_assets != null)
return true; return true;
@ -31,18 +60,39 @@ namespace UnityEngine.Rendering.HighDefinition.AMD.FSR3
return _assets != null; return _assets != null;
} }
public override bool IsLoaded() => _assets != null;
public override bool IsLoaded() => _nativePluginLoaded || _assets != null;
public override UpscalerContext CreateContext(in FSR2CommandInitializationData initSettings) public override UpscalerContext CreateContext(in FSR2CommandInitializationData initSettings)
{ {
var context = new FSR3UpscalerContext(in initSettings);
context.Init(_assets);
return context;
#if UNITY_STANDALONE_WIN
if (_nativePluginLoaded)
{
var context = new FSR3NativeUpscalerContext(in initSettings);
context.Init();
return context;
}
else
#endif
{
var context = new FSR3UpscalerContext(in initSettings);
context.Init(_assets);
return context;
}
} }
public override void DestroyContext(UpscalerContext context) public override void DestroyContext(UpscalerContext context)
{ {
((FSR3UpscalerContext)context).Destroy();
switch (context)
{
#if UNITY_STANDALONE_WIN
case FSR3NativeUpscalerContext nativeContext:
nativeContext.Destroy();
break;
#endif
case FSR3UpscalerContext managedContext:
managedContext.Destroy();
break;
}
} }
public override bool GetRenderResolutionFromQualityMode(FSR2Quality qualityMode, uint displayWidth, uint displayHeight, out uint renderWidth, out uint renderHeight) public override bool GetRenderResolutionFromQualityMode(FSR2Quality qualityMode, uint displayWidth, uint displayHeight, out uint renderWidth, out uint renderHeight)
@ -65,6 +115,8 @@ namespace UnityEngine.Rendering.HighDefinition.AMD.FSR3
private readonly Fsr3Upscaler.DispatchDescription _dispatchDescription = new(); private readonly Fsr3Upscaler.DispatchDescription _dispatchDescription = new();
private readonly FSR2CommandInitializationData _initData; private readonly FSR2CommandInitializationData _initData;
private Texture2DArray _clearTextureArray;
internal FSR3UpscalerContext(in FSR2CommandInitializationData initSettings) internal FSR3UpscalerContext(in FSR2CommandInitializationData initSettings)
{ {
_initData = initSettings; _initData = initSettings;
@ -90,21 +142,30 @@ namespace UnityEngine.Rendering.HighDefinition.AMD.FSR3
Flags = flags, Flags = flags,
Shaders = assets.shaders, Shaders = assets.shaders,
}); });
_clearTextureArray = new Texture2DArray(1, 1, TextureXR.slices, GraphicsFormat.R32G32_SFloat, TextureCreationFlags.None);
for (int i = 0; i < TextureXR.slices; ++i) _clearTextureArray.SetPixels(new[] { Color.clear, }, i);
_clearTextureArray.Apply();
} }
internal void Destroy() internal void Destroy()
{ {
CoreUtils.Destroy(_clearTextureArray);
_context.Destroy(); _context.Destroy();
} }
public override void Execute(CommandBuffer cmd, in FSR2CommandExecutionData executeData, in FSR2TextureTable textures) public override void Execute(CommandBuffer cmd, in FSR2CommandExecutionData executeData, in FSR2TextureTable textures)
{ {
bool useTextureArrays = TextureXR.useTexArray && textures.colorInput.dimension == TextureDimension.Tex2DArray;
ResourceView clearTexture = useTextureArrays ? new ResourceView(_clearTextureArray) : new ResourceView();
_dispatchDescription.Color = new ResourceView(textures.colorInput); _dispatchDescription.Color = new ResourceView(textures.colorInput);
_dispatchDescription.Depth = new ResourceView(textures.depth); _dispatchDescription.Depth = new ResourceView(textures.depth);
_dispatchDescription.MotionVectors = new ResourceView(textures.motionVectors); _dispatchDescription.MotionVectors = new ResourceView(textures.motionVectors);
_dispatchDescription.Exposure = new ResourceView(textures.exposureTexture);
_dispatchDescription.Reactive = new ResourceView(textures.biasColorMask);
_dispatchDescription.TransparencyAndComposition = new ResourceView(textures.transparencyMask);
_dispatchDescription.Exposure = textures.exposureTexture != null ? new ResourceView(textures.exposureTexture) : new ResourceView();
_dispatchDescription.Reactive = textures.biasColorMask != null ? new ResourceView(textures.biasColorMask) : clearTexture;
_dispatchDescription.TransparencyAndComposition = textures.transparencyMask != null ? new ResourceView(textures.transparencyMask) : clearTexture;
_dispatchDescription.Output = new ResourceView(textures.colorOutput); _dispatchDescription.Output = new ResourceView(textures.colorOutput);
_dispatchDescription.JitterOffset = new Vector2(executeData.jitterOffsetX, executeData.jitterOffsetY); _dispatchDescription.JitterOffset = new Vector2(executeData.jitterOffsetX, executeData.jitterOffsetY);
@ -122,9 +183,85 @@ namespace UnityEngine.Rendering.HighDefinition.AMD.FSR3
_dispatchDescription.CameraFovAngleVertical = executeData.cameraFovAngleVertical; _dispatchDescription.CameraFovAngleVertical = executeData.cameraFovAngleVertical;
_dispatchDescription.ViewSpaceToMetersFactor = 1.0f; // 1 unit is 1 meter in Unity _dispatchDescription.ViewSpaceToMetersFactor = 1.0f; // 1 unit is 1 meter in Unity
_dispatchDescription.Flags = FSR3UpscalerPlugin.EnableDebugView ? Fsr3Upscaler.DispatchFlags.DrawDebugView : 0; _dispatchDescription.Flags = FSR3UpscalerPlugin.EnableDebugView ? Fsr3Upscaler.DispatchFlags.DrawDebugView : 0;
_dispatchDescription.UseTextureArrays = TextureXR.useTexArray && textures.colorInput.dimension == TextureDimension.Tex2DArray;
_dispatchDescription.UseTextureArrays = useTextureArrays;
_context.Dispatch(_dispatchDescription, cmd); _context.Dispatch(_dispatchDescription, cmd);
} }
} }
#if UNITY_STANDALONE_WIN
public class FSR3NativeUpscalerContext : UpscalerContext
{
private AMDUP.FSR2Context _nativeContext;
private readonly FSR2CommandInitializationData _initData;
internal FSR3NativeUpscalerContext(in FSR2CommandInitializationData initSettings)
{
_initData = initSettings;
}
internal void Init()
{
AMDUP.FSR2CommandInitializationData initSettings = new()
{
maxRenderSizeWidth = _initData.maxRenderSizeWidth,
maxRenderSizeHeight = _initData.maxRenderSizeHeight,
displaySizeWidth = _initData.displaySizeWidth,
displaySizeHeight = _initData.displaySizeHeight,
ffxFsrFlags = (AMDUP.FfxFsr2InitializationFlags)_initData.ffxFsrFlags,
};
CommandBuffer cmd = new();
_nativeContext = AMDUP.GraphicsDevice.device.CreateFeature(cmd, in initSettings);
Graphics.ExecuteCommandBuffer(cmd);
cmd.Release();
}
internal void Destroy()
{
if (_nativeContext == null)
return;
CommandBuffer cmd = new();
AMDUP.GraphicsDevice.device.DestroyFeature(cmd, _nativeContext);
Graphics.ExecuteCommandBuffer(cmd);
cmd.Release();
_nativeContext = null;
}
public override void Execute(CommandBuffer cmd, in FSR2CommandExecutionData executeData, in FSR2TextureTable textures)
{
ref var execData = ref _nativeContext.executeData;
execData.jitterOffsetX = executeData.jitterOffsetX;
execData.jitterOffsetY = executeData.jitterOffsetY;
execData.MVScaleX = executeData.MVScaleX;
execData.MVScaleY = executeData.MVScaleY;
execData.renderSizeWidth = executeData.renderSizeWidth;
execData.renderSizeHeight = executeData.renderSizeHeight;
execData.enableSharpening = executeData.enableSharpening;
execData.sharpness = executeData.sharpness;
execData.frameTimeDelta = executeData.frameTimeDelta;
execData.preExposure = executeData.preExposure;
execData.reset = executeData.reset;
execData.cameraNear = executeData.cameraNear;
execData.cameraFar = executeData.cameraFar;
execData.cameraFovAngleVertical = executeData.cameraFovAngleVertical;
AMDUP.FSR2TextureTable textureTable = new()
{
colorInput = textures.colorInput,
depth = textures.depth,
motionVectors = textures.motionVectors,
exposureTexture = textures.exposureTexture,
biasColorMask = textures.biasColorMask,
reactiveMask = textures.reactiveMask,
transparencyMask = textures.transparencyMask,
colorOutput = textures.colorOutput,
};
AMDUP.GraphicsDevice.device.ExecuteFSR2(cmd, _nativeContext, in textureTable);
}
}
#endif
} }

26
Packages/com.unity.ugui/Tests/Editor/TMP/Unity.TextMeshPro.Editor.Tests.asmdef

@ -1,17 +1,27 @@
{ {
"name": "Unity.TextMeshPro.Editor.Tests", "name": "Unity.TextMeshPro.Editor.Tests",
"rootNamespace": "",
"references": [ "references": [
"Unity.TextMeshPro", "Unity.TextMeshPro",
"Unity.TextMeshPro.Editor"
"Unity.TextMeshPro.Editor",
"UnityEngine.TestRunner",
"UnityEditor.TestRunner"
], ],
"optionalUnityReferences": [
"TestAssemblies"
],
"defineConstraints": [
"UNITY_INCLUDE_TESTS"
],
"includePlatforms": [ "includePlatforms": [
"Editor" "Editor"
], ],
"excludePlatforms": []
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": true,
"precompiledReferences": [
"nunit.framework.dll"
],
"autoReferenced": false,
"defineConstraints": [
"UNITY_INCLUDE_TESTS",
"UNITY_INCLUDE_TESTS",
"UGUI_TESTS_ENABLED"
],
"versionDefines": [],
"noEngineReferences": false
} }

2
Packages/com.unity.ugui/Tests/Editor/UGUI/UI/PropertyDrawers/PropertyDrawerTests.cs

@ -51,7 +51,7 @@ public class PropertyDrawerTests
static PropertyDrawerTestsWindow window; static PropertyDrawerTestsWindow window;
[UnitySetUp] [UnitySetUp]
[MenuItem("Tests/Open Property Drawer Test Window")]
// WW1MOD: Disabled this menu item [MenuItem("Tests/Open Property Drawer Test Window")]
public static IEnumerator SetUp() public static IEnumerator SetUp()
{ {
VisualTreeBindingsUpdater.disableBindingsThrottling = true; VisualTreeBindingsUpdater.disableBindingsThrottling = true;

24
Packages/com.unity.ugui/Tests/Editor/UGUI/UnityEditor.UI.EditorTests.asmdef

@ -1,14 +1,26 @@
{ {
"name": "UnityEditor.UI.EditorTests", "name": "UnityEditor.UI.EditorTests",
"rootNamespace": "",
"references": [ "references": [
"UnityEditor.UI", "UnityEditor.UI",
"UnityEngine.UI"
],
"optionalUnityReferences": [
"TestAssemblies"
"UnityEngine.UI",
"UnityEngine.TestRunner",
"UnityEditor.TestRunner"
], ],
"includePlatforms": [ "includePlatforms": [
"Editor" "Editor"
], ],
"excludePlatforms": []
}
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": true,
"precompiledReferences": [
"nunit.framework.dll"
],
"autoReferenced": false,
"defineConstraints": [
"UNITY_INCLUDE_TESTS",
"UGUI_TESTS_ENABLED"
],
"versionDefines": [],
"noEngineReferences": false
}

26
Packages/com.unity.ugui/Tests/Runtime/TMP/Unity.TextMeshPro.Tests.asmdef

@ -1,14 +1,24 @@
{ {
"name": "Unity.TextMeshPro.Tests", "name": "Unity.TextMeshPro.Tests",
"rootNamespace": "",
"references": [ "references": [
"Unity.TextMeshPro"
"Unity.TextMeshPro",
"UnityEngine.TestRunner",
"UnityEditor.TestRunner"
], ],
"optionalUnityReferences": [
"TestAssemblies"
],
"defineConstraints": [
"UNITY_INCLUDE_TESTS"
],
"includePlatforms": [], "includePlatforms": [],
"excludePlatforms": []
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": true,
"precompiledReferences": [
"nunit.framework.dll"
],
"autoReferenced": false,
"defineConstraints": [
"UNITY_INCLUDE_TESTS",
"UNITY_INCLUDE_TESTS",
"UGUI_TESTS_ENABLED"
],
"versionDefines": [],
"noEngineReferences": false
} }

6
Packages/com.unity.ugui/Tests/Runtime/UGUI/UnityEngine.UI.Tests.asmdef

@ -1,5 +1,6 @@
{ {
"name": "UnityEngine.UI.Tests", "name": "UnityEngine.UI.Tests",
"rootNamespace": "",
"references": [ "references": [
"UnityEngine.UI", "UnityEngine.UI",
"UnityEngine.TestRunner", "UnityEngine.TestRunner",
@ -14,7 +15,8 @@
], ],
"autoReferenced": false, "autoReferenced": false,
"defineConstraints": [ "defineConstraints": [
"UNITY_INCLUDE_TESTS"
"UNITY_INCLUDE_TESTS",
"UGUI_TESTS_ENABLED"
], ],
"versionDefines": [ "versionDefines": [
{ {
@ -39,4 +41,4 @@
} }
], ],
"noEngineReferences": false "noEngineReferences": false
}
}
Loading…
Cancel
Save