From 0decd47dd002ceb9213a75b9ddf33f7ed88ca1b6 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Tue, 9 Jun 2020 16:17:06 +0200 Subject: [PATCH 1/3] Recompute the mip info before generating the mipchain --- .../Runtime/RenderPipeline/HDRenderPipeline.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index becb97dd8ff..ff98aab5c35 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -4538,7 +4538,7 @@ void RenderColorPyramid(HDCamera hdCamera, CommandBuffer cmd, bool isPreRefracti void GenerateDepthPyramid(HDCamera hdCamera, CommandBuffer cmd, FullScreenDebugMode debugMode) { CopyDepthBufferIfNeeded(hdCamera, cmd); - + m_SharedRTManager.GetDepthBufferMipChainInfo().ComputePackedMipChainInfo(new Vector2Int(hdCamera.actualWidth, hdCamera.actualHeight)); int mipCount = m_SharedRTManager.GetDepthBufferMipChainInfo().mipLevelCount; using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.DepthPyramid))) From 5be86e84190e284f8bc96bac76da52f9e51de640 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Wed, 10 Jun 2020 11:08:56 +0200 Subject: [PATCH 2/3] changelog --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 95ecf55ea4f..0b5559573ac 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -652,6 +652,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fix an issue with the color intensity of emissive for performance rtgi - Fixed issue with rendering being mostly broken when target platform disables VR. - Workaround an issue caused by GetKernelThreadGroupSizes failing to retrieve correct group size. +- Fixed issue with depth pyramid generation and dynamic resolution. ### Changed - Improve MIP selection for decals on Transparents From 22c9647489afbd63b2537efeb9859fdfb5deff14 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Wed, 10 Jun 2020 11:20:06 +0200 Subject: [PATCH 3/3] avoid compute mipchain if not needed --- .../Runtime/RenderPipeline/Utility/HDUtils.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs index 69e5fee1443..54c5134ecab 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs @@ -505,6 +505,10 @@ public void Allocate() // This function is NOT fast, but it is illustrative, and can be optimized later. public void ComputePackedMipChainInfo(Vector2Int viewportSize) { + // No work needed. + if (viewportSize == mipLevelSizes[0]) + return; + textureSize = viewportSize; mipLevelSizes[0] = viewportSize; mipLevelOffsets[0] = Vector2Int.zero;