diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 9a7a4a54260..6b5bdd9aa01 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed - Fixed case where material keywords would not get setup before usage. - Fixed shader warning in ReflectionDenoiser +- Fixed XR depth copy (case 1286908). ## [7.5.2] - 2020-11-16 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 b984820df5e..4f04998253a 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 @@ -271,6 +271,7 @@ void SetFinalTarget(RenderGraph renderGraph, HDCamera hdCamera, RenderGraphResou #if UNITY_EDITOR 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 = finalTarget; passData.finalViewport = hdCamera.finalViewport; 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 d6992f0c733..e1d80deb12e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -2469,10 +2469,9 @@ void Callback(CommandBuffer c, HDCamera cam) using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.XRDepthCopy))) { var depthBuffer = m_SharedRTManager.GetDepthStencilBuffer(); - var rtScale = depthBuffer.rtHandleProperties.rtHandleScale / DynamicResolutionHandler.instance.GetCurrentScale(); m_CopyDepthPropertyBlock.SetTexture(HDShaderIDs._InputDepth, depthBuffer); - m_CopyDepthPropertyBlock.SetVector(HDShaderIDs._BlitScaleBias, rtScale); + m_CopyDepthPropertyBlock.SetVector(HDShaderIDs._BlitScaleBias, new Vector4(1.0f, 1.0f, 0.0f, 0.0f)); m_CopyDepthPropertyBlock.SetInt("_FlipY", 1); cmd.SetRenderTarget(target.id, 0, CubemapFace.Unknown, -1);