Skip to content

Commit

Permalink
[6.0/editor] Fixed scene filtering with rendergraph not working on metal
Browse files Browse the repository at this point in the history
Editor: when doing scene filter we reuse depth from the "normal" render pass to draw selection highlights in "filter" pass, so it needs to be preserved in render graph
  • Loading branch information
alexey-unity authored and Evergreen committed Nov 28, 2024
1 parent bfe6926 commit bff5f11
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,12 @@ void CreateRenderGraphCameraRenderTargets(RenderGraph renderGraph, bool isCamera
RenderingUtils.ReAllocateHandleIfNeeded(ref m_RenderGraphCameraDepthHandle, depthDescriptor, FilterMode.Point, TextureWrapMode.Clamp, name: "_CameraDepthAttachment");

importDepthParams.discardOnLastUse = lastCameraInTheStack;
#if UNITY_EDITOR
// scene filtering will reuse "camera" depth from the normal pass for the "filter highlight" effect
if (cameraData.isSceneViewCamera && CoreUtils.IsSceneFilteringEnabled())
importDepthParams.discardOnLastUse = false;
#endif

resourceData.cameraDepth = renderGraph.ImportTexture(m_RenderGraphCameraDepthHandle, importDepthParams);
resourceData.activeDepthID = UniversalResourceData.ActiveID.Camera;

Expand Down

0 comments on commit bff5f11

Please sign in to comment.