Skip to content

Commit 608fe23

Browse files
sebastienlagardepmavridisFrancescoC-unityjohnparsanisunity
authored
[HDRP] Merge Hd/bugfix (#4713)
* [HDRP] Fix AxF debug output in certain configurations (#4641) * Fix AxF debug output in certain configurations. * Update comment * Fix SSR accumulation white flash (#4648) * Fix white flash * changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Display Info Box when MSAA + ray tracing is onr (#4627) * Show info box when ray tracing is enabled. * Changelog * Move below MSAA Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fix distortion when resizing the window in player builds with the Graphics Compositor enabled (#4593) Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Add support for the camera bridge in the graphics compositor (#4599) * Fix Jittered Project Matrix Infinite Far Clip Plane (#4638) * Reconstruct jittered projection matrix far plane (for Infinite ) * Changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fixed a memory leak related to not disposing of the RTAS at the end HDRP's lifecycle. (#4688) Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fix custom pass utils Blur + Copy overdraw. (#4623) * Fix overdraw in custom pass utils blur function * Updated changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fix draw procedural invalid pass idx 1 on first template load (#4632) * Fix * changelog * Force sync compilation for TAA Co-authored-by: CifaCia <f.cifariellociardi@gmail.com> Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Changed light reset to preserve type (#4624) Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Revert "Add support for the camera bridge in the graphics compositor (#4599)" This reverts commit 2325e3f. * AxF carpaint: Fix a compilation issue on Vulkan until the cpp HLSLcc side is updated. (case 1335737, related to 1314040) (#4691) Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Revert "Revert "Add support for the camera bridge in the graphics compositor (#4599)"" This reverts commit 30fffd5. * revert: Fix distortion when resizing the window in player builds with the Graphi Co-authored-by: Pavlos Mavridis <pavlos.mavridis@unity3d.com> Co-authored-by: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com> Co-authored-by: John Parsaie <johnpa@unity3d.com> Co-authored-by: anisunity <42026998+anisunity@users.noreply.github.com> Co-authored-by: Antoine Lelievre <antoinel@unity3d.com> Co-authored-by: CifaCia <f.cifariellociardi@gmail.com> Co-authored-by: Adrien de Tocqueville <adrien.tocqueville@unity3d.com> Co-authored-by: slunity <37302815+slunity@users.noreply.github.com>
1 parent 86af16e commit 608fe23

File tree

11 files changed

+120
-23
lines changed

11 files changed

+120
-23
lines changed

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
6464
- Added support for internal plugin materials and HDSubTarget with their versioning system.
6565
- Added a slider that controls how much the volumetric clouds erosion value affects the ambient occlusion term.
6666
- Added three animation curves to control the density, erosion, and ambient occlusion in the custom submode of the simple controls.
67+
- Added support for the camera bridge in the graphics compositor
6768

6869
### Fixed
6970
- Fixed Intensity Multiplier not affecting realtime global illumination.
@@ -207,7 +208,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
207208
- Fixed diffusion profile breaking after upgrading HDRP (case 1337892).
208209
- Fixed undo on light anchor.
209210
- Fixed some depth comparison instabilities with volumetric clouds.
210-
- Make LitTessellation and LayeredLitTessellation fallback on Lit and LayeredLit respectively in DXR.
211+
- Fixed AxF debug output in certain configurations (case 1333780).
212+
- Fixed white flash when camera is reset and SSR Accumulation mode is on.
213+
- Fixed an issue with TAA causing objects not to render at extremely high far flip plane values.
214+
- Fixed a memory leak related to not disposing of the RTAS at the end HDRP's lifecycle.
215+
- Fixed overdraw in custom pass utils blur and Copy functions (case 1333648);
216+
- Fixed invalid pass index 1 in DrawProcedural error.
217+
- Fixed a compilation issue for AxF carpaints on Vulkan (case 1314040).
211218

212219
### Changed
213220
- Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard
@@ -289,6 +296,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
289296
- Changed the storage format of volumetric clouds presets for easier editing.
290297
- Reduced the maximum distance per ray step of volumetric clouds.
291298
- Improved the fly through ghosting artifacts in the volumetric clouds.
299+
- Make LitTessellation and LayeredLitTessellation fallback on Lit and LayeredLit respectively in DXR.
300+
- Display an info box and disable MSAA asset entry when ray tracing is enabled.
301+
- Changed light reset to preserve type.
292302

293303
## [11.0.0] - 2020-10-21
294304

com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.ContextualMenu.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ static void ResetLight(MenuCommand menuCommand)
2727

2828
Light light = go.GetComponent<Light>();
2929
HDAdditionalLightData lightAdditionalData = go.GetComponent<HDAdditionalLightData>();
30+
HDLightType lightType = lightAdditionalData.type;
3031

3132
Assert.IsNotNull(light);
3233
Assert.IsNotNull(lightAdditionalData);
@@ -36,6 +37,7 @@ static void ResetLight(MenuCommand menuCommand)
3637
// To avoid duplicating init code we copy default settings to Reset additional data
3738
// Note: we can't call this code inside the HDAdditionalLightData, thus why we don't wrap it in a Reset() function
3839
HDUtils.s_DefaultHDAdditionalLightData.CopyTo(lightAdditionalData);
40+
lightAdditionalData.type = lightType;
3941

4042
//reinit default intensity
4143
HDAdditionalLightData.InitDefaultHDAdditionalLightData(lightAdditionalData);

com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.Skin.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ public class Styles
149149
public static readonly GUIContent supportedRayTracingMode = EditorGUIUtility.TrTextContent("Supported Ray Tracing Mode (Preview)");
150150
public static readonly GUIContent rayTracingUnsupportedWarning = EditorGUIUtility.TrTextContent("Ray tracing is not supported on your device. Please refer to the documentation.");
151151
public static readonly GUIContent rayTracingDX12OnlyWarning = EditorGUIUtility.TrTextContent("Ray tracing is currently only supported on DX12.");
152+
public static readonly GUIContent rayTracingMSAAUnsupported = EditorGUIUtility.TrTextContent("When Ray tracing is enabled in asset, MSAA is not supported. Please refer to the documentation.");
152153
public static readonly GUIContent maximumLODLevel = EditorGUIUtility.TrTextContent("Maximum LOD Level");
153154
public static readonly GUIContent LODBias = EditorGUIUtility.TrTextContent("LOD Bias");
154155
public static readonly GUIContent supportProbeVolumeContent = EditorGUIUtility.TrTextContent("Enable", "When enabled, HDRP allocates Shader variants and memory for probe volume based GI. This allows you to use probe volumes in your Unity Project.");

com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,17 +1138,26 @@ static void Drawer_SectionRenderingUnsorted(SerializedHDRenderPipelineAsset seri
11381138
// MSAA is an option that is only available in full forward but Camera can be set in Full Forward only. Thus MSAA have no dependency currently
11391139
//Note: do not use SerializedProperty.enumValueIndex here as this enum not start at 0 as it is used as flags.
11401140
bool msaaAllowed = true;
1141+
bool hasRayTracing = false;
11411142
for (int index = 0; index < serialized.serializedObject.targetObjects.Length && msaaAllowed; ++index)
11421143
{
1143-
var litShaderMode = (serialized.serializedObject.targetObjects[index] as HDRenderPipelineAsset).currentPlatformRenderPipelineSettings.supportedLitShaderMode;
1144-
msaaAllowed &= litShaderMode == SupportedLitShaderMode.ForwardOnly || litShaderMode == SupportedLitShaderMode.Both;
1144+
var settings = (serialized.serializedObject.targetObjects[index] as HDRenderPipelineAsset).currentPlatformRenderPipelineSettings;
1145+
var litShaderMode = settings.supportedLitShaderMode;
1146+
bool rayTracedSupported = settings.supportRayTracing;
1147+
hasRayTracing |= rayTracedSupported;
1148+
msaaAllowed &= (litShaderMode == SupportedLitShaderMode.ForwardOnly || litShaderMode == SupportedLitShaderMode.Both) && !rayTracedSupported;
11451149
}
1150+
11461151
using (new EditorGUI.DisabledScope(!msaaAllowed))
11471152
{
11481153
++EditorGUI.indentLevel;
11491154
EditorGUILayout.PropertyField(serialized.renderPipelineSettings.MSAASampleCount, Styles.MSAASampleCountContent);
11501155
--EditorGUI.indentLevel;
11511156
}
1157+
if (hasRayTracing && serialized.renderPipelineSettings.MSAASampleCount.intValue != (int)MSAASamples.None)
1158+
{
1159+
EditorGUILayout.HelpBox(Styles.rayTracingMSAAUnsupported.text, MessageType.Info, wide: true);
1160+
}
11521161

11531162
EditorGUILayout.PropertyField(serialized.renderPipelineSettings.supportMotionVectors, Styles.supportMotionVectorContent);
11541163
EditorGUILayout.PropertyField(serialized.renderPipelineSettings.supportRuntimeDebugDisplay, Styles.supportRuntimeDebugDisplayContent);

com.unity.render-pipelines.high-definition/Runtime/Compositor/CompositionManager.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,12 +802,39 @@ void CustomRender(ScriptableRenderContext context, HDCamera camera)
802802

803803
if (camera.camera.targetTexture)
804804
{
805+
// When rendering to texture (or to camera bridge) we don't need to flip the image.
806+
// If this matrix was used for the game view, then the image would appear flipped, hense the name of the variable.
805807
m_ShaderVariablesGlobalCB._ViewProjMatrix = m_ViewProjMatrixFlipped;
806808
ConstantBuffer.PushGlobal(cmd, m_ShaderVariablesGlobalCB, HDShaderIDs._ShaderVariablesGlobal);
807809
cmd.Blit(null, camera.camera.targetTexture, m_Material, m_Material.FindPass("ForwardOnly"));
810+
811+
var recorderCaptureActions = CameraCaptureBridge.GetCaptureActions(camera.camera);
812+
if (recorderCaptureActions != null)
813+
{
814+
for (recorderCaptureActions.Reset(); recorderCaptureActions.MoveNext();)
815+
{
816+
recorderCaptureActions.Current(camera.camera.targetTexture, cmd);
817+
}
818+
}
808819
}
809820
else
810821
{
822+
var recorderCaptureActions = CameraCaptureBridge.GetCaptureActions(camera.camera);
823+
824+
if (recorderCaptureActions != null)
825+
{
826+
m_ShaderVariablesGlobalCB._ViewProjMatrix = m_ViewProjMatrixFlipped;
827+
cmd.SetInvertCulling(true);
828+
ConstantBuffer.PushGlobal(cmd, m_ShaderVariablesGlobalCB, HDShaderIDs._ShaderVariablesGlobal);
829+
cmd.Blit(null, BuiltinRenderTextureType.CameraTarget, m_Material, m_Material.FindPass("ForwardOnly"));
830+
for (recorderCaptureActions.Reset(); recorderCaptureActions.MoveNext();)
831+
{
832+
recorderCaptureActions.Current(BuiltinRenderTextureType.CameraTarget, cmd);
833+
}
834+
cmd.SetInvertCulling(false);
835+
}
836+
837+
// When we render directly to game view, we render the image flipped up-side-down, like other HDRP cameras
811838
m_ShaderVariablesGlobalCB._ViewProjMatrix = m_ViewProjMatrix;
812839
ConstantBuffer.PushGlobal(cmd, m_ShaderVariablesGlobalCB, HDShaderIDs._ShaderVariablesGlobal);
813840
cmd.Blit(null, BuiltinRenderTextureType.CameraTarget, m_Material, m_Material.FindPass("ForwardOnly"));

com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxFData.hlsl

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,23 @@ struct TextureUVMapping
9898
#endif
9999

100100
#define GETSURFACEANDBUILTINDATA_RAYCONE_PARAM ((RayCone)0)
101-
#define AXF_CALCULATE_TEXTURE2D_LOD(a,b,c,duvdx,duvdy,scales,texelSize,rayCone) CALCULATE_TEXTURE2D_LOD(a,b,c)
102101

102+
#if !defined(SHADER_API_VULKAN)
103+
#define AXF_CALCULATE_TEXTURE2D_LOD(a,b,c,duvdx,duvdy,scales,texelSize,rayCone) CALCULATE_TEXTURE2D_LOD(a,b,c)
103104
#else
105+
// case 1335737: For Vulkan, our HLSLcc is missing an overloaded version when the texture object is a Texture2DArray.
106+
// This won't create a problem anyway if we use gradients instead of LOD sampling, we just make sure the shader is
107+
// configured as such on this platform. We also place a dummy macro since although eventually optimized out, HLSLcc
108+
// will fail before the optimization prunes it out.
109+
#define AXF_CALCULATE_TEXTURE2D_LOD(a,b,c,duvdx,duvdy,scales,texelSize,rayCone) (0)
110+
111+
#ifndef FLAKES_USE_DDXDDY
112+
#define FLAKES_USE_DDXDDY
113+
#endif
114+
115+
#endif // #if !defined(SHADER_API_VULKAN)
104116

117+
#else
105118
//-----------------------------------------------------------------------------
106119
//defined(SHADER_STAGE_RAY_TRACING)
107120

@@ -636,8 +649,17 @@ void GetSurfaceAndBuiltinData(FragInputs input, float3 V, inout PositionInputs p
636649

637650
// The AxF models include both a general coloring term that they call "specular color" while the f0 is actually another term,
638651
// seemingly always scalar:
652+
#ifndef DEBUG_DISPLAY
639653
surfaceData.fresnel0 = AXF_SAMPLE_SMP_TEXTURE2D(_SVBRDF_FresnelMap, sampler_SVBRDF_FresnelMap, uvMapping).x;
640654
surfaceData.height_mm = AXF_SAMPLE_SMP_TEXTURE2D(_SVBRDF_HeightMap, sampler_SVBRDF_HeightMap, uvMapping).x * _SVBRDF_HeightMapMaxMM;
655+
#else
656+
// [case 1333780]: For debug display we run out of samplers (max 16 on dx11/ps5.0) in certain configurations for two reasons:
657+
// - An extra sampler is used for mat cap
658+
// - The auto-generated debug code can visualize all texture properties so nothing is stripped out (unlike the non-debug case)
659+
// To save sampler states in Debug, we reuse the sampler state of the color map for some other maps too.
660+
surfaceData.fresnel0 = AXF_SAMPLE_SMP_TEXTURE2D(_SVBRDF_FresnelMap, sampler_SVBRDF_DiffuseColorMap, uvMapping).x;
661+
surfaceData.height_mm = AXF_SAMPLE_SMP_TEXTURE2D(_SVBRDF_HeightMap, sampler_SVBRDF_DiffuseColorMap, uvMapping).x * _SVBRDF_HeightMapMaxMM;
662+
#endif
641663
// Our importer range remaps the [-HALF_PI, HALF_PI) range to [0,1). We map back here:
642664
surfaceData.anisotropyAngle =
643665
HALF_PI * (2.0 * AXF_SAMPLE_SMP_TEXTURE2D(_SVBRDF_AnisoRotationMap, sampler_SVBRDF_AnisoRotationMap, uvMapping).x - 1.0);

com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Shader "Hidden/HDRP/TemporalAA"
1616
#pragma multi_compile_local_fragment _ ANTI_RINGING
1717
#pragma multi_compile_local_fragment LOW_QUALITY MEDIUM_QUALITY HIGH_QUALITY POST_DOF
1818

19+
#pragma editor_sync_compilation
20+
1921
#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch
2022

2123
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ public struct ViewConstants
9494
public bool volumetricHistoryIsValid = false;
9595

9696
internal int volumetricValidFrames = 0;
97+
internal int colorPyramidHistoryValidFrames = 0;
9798

9899
/// <summary>Width actually used for rendering after dynamic resolution and XR is applied.</summary>
99100
public int actualWidth { get; private set; }
@@ -147,6 +148,7 @@ public void Reset()
147148
volumetricHistoryIsValid = false;
148149
volumetricValidFrames = 0;
149150
colorPyramidHistoryIsValid = false;
151+
colorPyramidHistoryValidFrames = 0;
150152
dofHistoryIsValid = false;
151153

152154
// Reset the volumetric cloud offset animation data
@@ -1674,6 +1676,11 @@ Matrix4x4 GetJitteredProjectionMatrix(Matrix4x4 origProj)
16741676
planes.top += planeJitter.y;
16751677
planes.bottom += planeJitter.y;
16761678

1679+
// Reconstruct the far plane for the jittered matrix.
1680+
// For extremely high far clip planes, the decomposed projection zFar evaluates to infinity.
1681+
if (float.IsInfinity(planes.zFar))
1682+
planes.zFar = frustum.planes[5].distance;
1683+
16771684
proj = Matrix4x4.Frustum(planes);
16781685
}
16791686

com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ class RenderSSRPassData
403403
public bool usePBRAlgo;
404404
public bool accumNeedClear;
405405
public bool previousAccumNeedClear;
406+
public bool validColorPyramid;
406407

407408
public int width, height, viewCount;
408409

@@ -511,6 +512,7 @@ TextureHandle RenderSSR(RenderGraph renderGraph,
511512
passData.accumNeedClear = usePBRAlgo;
512513
passData.previousAccumNeedClear = usePBRAlgo && (hdCamera.currentSSRAlgorithm == ScreenSpaceReflectionAlgorithm.Approximation || hdCamera.isFirstFrame || hdCamera.resetPostProcessingHistory);
513514
hdCamera.currentSSRAlgorithm = volumeSettings.usedAlgorithm.value; // Store for next frame comparison
515+
passData.validColorPyramid = hdCamera.colorPyramidHistoryValidFrames > 1;
514516

515517
passData.depthBuffer = builder.ReadTexture(prepassOutput.depthBuffer);
516518
passData.depthPyramid = builder.ReadTexture(prepassOutput.depthPyramidTexture);
@@ -603,22 +605,30 @@ TextureHandle RenderSSR(RenderGraph renderGraph,
603605

604606
if (data.usePBRAlgo)
605607
{
606-
using (new ProfilingScope(ctx.cmd, ProfilingSampler.Get(HDProfileId.SsrAccumulate)))
608+
if (!data.validColorPyramid)
607609
{
608-
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._DepthTexture, data.depthBuffer);
609-
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._CameraDepthTexture, data.depthPyramid);
610-
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._NormalBufferTexture, data.normalBuffer);
611-
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._ColorPyramidTexture, data.colorPyramid);
612-
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._SsrHitPointTexture, data.hitPointsTexture);
613-
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._SSRAccumTexture, data.ssrAccum);
614-
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._SsrLightingTextureRW, data.lightingTexture);
615-
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._SsrAccumPrev, data.ssrAccumPrev);
616-
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._SsrClearCoatMaskTexture, data.clearCoatMask);
617-
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._CameraMotionVectorsTexture, data.motionVectorsBuffer);
618-
619-
ConstantBuffer.Push(ctx.cmd, data.cb, cs, HDShaderIDs._ShaderVariablesScreenSpaceReflection);
620-
621-
ctx.cmd.DispatchCompute(cs, data.accumulateKernel, HDUtils.DivRoundUp(data.width, 8), HDUtils.DivRoundUp(data.height, 8), data.viewCount);
610+
CoreUtils.SetRenderTarget(ctx.cmd, data.ssrAccum, ClearFlag.Color, Color.clear);
611+
CoreUtils.SetRenderTarget(ctx.cmd, data.ssrAccumPrev, ClearFlag.Color, Color.clear);
612+
}
613+
else
614+
{
615+
using (new ProfilingScope(ctx.cmd, ProfilingSampler.Get(HDProfileId.SsrAccumulate)))
616+
{
617+
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._DepthTexture, data.depthBuffer);
618+
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._CameraDepthTexture, data.depthPyramid);
619+
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._NormalBufferTexture, data.normalBuffer);
620+
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._ColorPyramidTexture, data.colorPyramid);
621+
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._SsrHitPointTexture, data.hitPointsTexture);
622+
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._SSRAccumTexture, data.ssrAccum);
623+
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._SsrLightingTextureRW, data.lightingTexture);
624+
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._SsrAccumPrev, data.ssrAccumPrev);
625+
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._SsrClearCoatMaskTexture, data.clearCoatMask);
626+
ctx.cmd.SetComputeTextureParam(cs, data.accumulateKernel, HDShaderIDs._CameraMotionVectorsTexture, data.motionVectorsBuffer);
627+
628+
ConstantBuffer.Push(ctx.cmd, data.cb, cs, HDShaderIDs._ShaderVariablesScreenSpaceReflection);
629+
630+
ctx.cmd.DispatchCompute(cs, data.accumulateKernel, HDUtils.DivRoundUp(data.width, 8), HDUtils.DivRoundUp(data.height, 8), data.viewCount);
631+
}
622632
}
623633
}
624634
});
@@ -639,8 +649,13 @@ TextureHandle RenderSSR(RenderGraph renderGraph,
639649
if (!hdCamera.colorPyramidHistoryIsValid)
640650
{
641651
hdCamera.colorPyramidHistoryIsValid = true; // For the next frame...
652+
hdCamera.colorPyramidHistoryValidFrames = 0;
642653
result = renderGraph.defaultResources.blackTextureXR;
643654
}
655+
else
656+
{
657+
hdCamera.colorPyramidHistoryValidFrames++;
658+
}
644659
}
645660

646661
PushFullScreenDebugTexture(renderGraph, result, transparent ? FullScreenDebugMode.TransparentScreenSpaceReflections : FullScreenDebugMode.ScreenSpaceReflections);

com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingManager.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ internal void InitRayTracingManager()
9696

9797
internal void ReleaseRayTracingManager()
9898
{
99+
m_CurrentRAS.Dispose();
100+
99101
if (m_RayTracingLightCluster != null)
100102
m_RayTracingLightCluster.ReleaseResources();
101103
if (m_RayCountManager != null)

0 commit comments

Comments
 (0)