diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index c3d10bcfcb9..751ae31c62f 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -115,6 +115,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Display a warning help box when decal atlas is out of size. - Moved the HDRP render graph debug panel content to the Rendering debug panel. - Changed Path Tracing's maximum intensity from clamped (0 to 100) to positive value (case 1310514). +- Avoid unnecessary RenderGraphBuilder.ReadTexture in the "Set Final Target" pass ## [11.0.0] - 2020-10-21 diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs index 4eac989018f..65f333d4f2a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs @@ -411,11 +411,15 @@ void SetFinalTarget(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle de passData.copyDepth = passData.copyDepth || hdCamera.isMainGameView; // Specific case of Debug.DrawLine and Debug.Ray #endif passData.copyDepth = passData.copyDepth && !hdCamera.xr.enabled; - passData.copyDepthMaterial = m_CopyDepth; passData.finalTarget = builder.WriteTexture(finalTarget); passData.finalViewport = hdCamera.finalViewport; - passData.depthBuffer = builder.ReadTexture(depthBuffer); - passData.flipY = hdCamera.isMainGameView; + + if (passData.copyDepth) + { + passData.depthBuffer = builder.ReadTexture(depthBuffer); + passData.flipY = hdCamera.isMainGameView; + passData.copyDepthMaterial = m_CopyDepth; + } builder.SetRenderFunc( (SetFinalTargetPassData data, RenderGraphContext ctx) =>