From 5bdbde12ad91531bb5b2837b0d6a0590bcfef663 Mon Sep 17 00:00:00 2001 From: Fabien Houlmann Date: Tue, 12 Jan 2021 10:16:08 -0500 Subject: [PATCH 1/3] fix for XR depth copy and MSAA --- .../Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 9da56017ace..91880ea1559 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 @@ -270,7 +270,7 @@ void ExecuteWithRenderGraph(RenderRequest renderRequest, RenderCustomPass(m_RenderGraph, hdCamera, postProcessDest, prepassOutput, customPassCullingResults, cullingResults, CustomPassInjectionPoint.AfterPostProcess, aovRequest, aovCustomPassBuffers); - CopyXRDepth(m_RenderGraph, hdCamera, prepassOutput.depthBuffer, backBuffer); + CopyXRDepth(m_RenderGraph, hdCamera, prepassOutput.resolvedDepthBuffer, backBuffer); // In developer build, we always render post process in an intermediate buffer at (0,0) in which we will then render debug. // Because of this, we need another blit here to the final render target at the right viewport. From 5b424185710dcd14beea37474a3aa9f2b13198f4 Mon Sep 17 00:00:00 2001 From: Fabien Houlmann Date: Tue, 12 Jan 2021 10:16:50 -0500 Subject: [PATCH 2/3] fix some RenderGraph edge cases with XR --- .../RenderPipeline/HDRenderPipeline.RenderGraph.cs | 9 ++++++++- .../RenderPipeline/HDRenderPipeline.RenderGraphUtils.cs | 2 +- .../Runtime/RenderPipeline/PathTracing/PathTracing.cs | 6 ------ 3 files changed, 9 insertions(+), 8 deletions(-) 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 91880ea1559..969f7662021 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 @@ -91,7 +91,14 @@ void ExecuteWithRenderGraph(RenderRequest renderRequest, // lightCluster.EvaluateClusterDebugView(cmd, hdCamera); //} - colorBuffer = RenderPathTracing(m_RenderGraph, hdCamera); + if (hdCamera.viewCount == 1) + { + colorBuffer = RenderPathTracing(m_RenderGraph, hdCamera); + } + else + { + Debug.LogWarning("Path Tracing is not supported with XR single-pass rendering."); + } } else { diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraphUtils.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraphUtils.cs index 71beea1e8b1..4e6df80af1f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraphUtils.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraphUtils.cs @@ -135,7 +135,7 @@ class RenderOcclusionMeshesPassData void RenderXROcclusionMeshes(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle colorBuffer, TextureHandle depthBuffer) { - if (hdCamera.xr.enabled && m_Asset.currentPlatformRenderPipelineSettings.xrSettings.occlusionMesh) + if (hdCamera.xr.hasValidOcclusionMesh && m_Asset.currentPlatformRenderPipelineSettings.xrSettings.occlusionMesh) { using (var builder = renderGraph.AddRenderPass("XR Occlusion Meshes", out var passData)) { diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/PathTracing.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/PathTracing.cs index 03710ddf95e..f91dc01b4e4 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/PathTracing.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/PathTracing.cs @@ -334,12 +334,6 @@ TextureHandle RenderPathTracing(RenderGraph renderGraph, HDCamera hdCamera) if (!pathTracingShader || !m_PathTracingSettings.enable.value) return TextureHandle.nullHandle; - if (hdCamera.viewCount > 1) - { - Debug.LogError("Path Tracing is not supported when using XR single-pass rendering."); - return TextureHandle.nullHandle; - } - CheckDirtiness(hdCamera); var parameters = PreparePathTracingParameters(hdCamera); From 08e63e650480d511d3ec095a38f549d764e49898 Mon Sep 17 00:00:00 2001 From: Fabien Houlmann Date: Tue, 12 Jan 2021 10:18:48 -0500 Subject: [PATCH 3/3] add entry to changelog --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 748233ef95c..42093ef4bd3 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -6,8 +6,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [12.0.0] - 2021-01-11 -Version Updated -The version number for this package has increased due to a version update of a related graphics package. +### Fixed +- Fixed XR depth copy when using MSAA. ## [11.0.0] - 2020-10-21