Calling SwapColorBuffer in URP causes depthTarget disappear

I create a custom RendererFeature execute at AfterRenderingSkybox.

The RendererFeature call ScriptableRenderPass.Blit(CommandBuffer cmd, ref RenderingData data, Material material, int passIndex = 0). After execute the RendererFeature, transparent objects have problems in depth testing when rendering, and cannot be obscured by opaque objects.

using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;

public class SwapColorBufferRendererFeature : ScriptableRendererFeature
    SwapColorBufferPass m_swapColorBuffer;

    class SwapColorBufferPass : ScriptableRenderPass
        public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
            CommandBuffer cmd = CommandBufferPool.Get(name: "SwapColorBufferPass");
            Blit(cmd, ref renderingData, null);

    public override void Create()
        m_swapColorBuffer = new SwapColorBufferPass();
        m_swapColorBuffer.renderPassEvent = RenderPassEvent.AfterRenderingSkybox;

    public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)

It was found that the depthTarget setting was invalid after calling UniversalRenderer.SwapColorBuffer(CommandBuffer cmd), and subsequent draws did not have depthTarget.

Unity Version: 2022.3.4f1
URP Version: 14.0.8


Would you kindly please report this issue via the Bug Reporter tool?
Please make sure to write the exact steps needed to be taken so that the reproduction would be visually seen. Also make sure to attach a reproduction project and any visual material so that when testing our CQA team can verify that they got the same results. If you can, please use this template:

How to reproduce:

  1. Open the attached project
  2. Do this
  3. Do that
  4. Select this
  5. Observe that

Expected result: Something is visible, something is printed or something happens
Actual result: The opposite of what I expect happens

Reproducible with: Editor version I am using (e.g: 2021.3.xf1)

Reproduced on: The OS I am on (e.g: Windows 11, macOS Ventura 13.1 (Intel/Silicon))

Bug report has been created: Unity Issue Tracker - DepthTarget disappears when calling SwapColorBuffer (