Need help writing depth in a ScriptableRender Pass using DrawRenderers

I am working on a SRP that does per object bloom based on a layer mask. I have most of this working correctly using ScriptableRenderContext.DrawRenderers() with correct filter settings. This generates an additonal render pass that then blit to a bloom pyramid pass:

However, I cannot seem to get it to correctly write depth so that I can mask the bloom blit against the existing geo.

Configurtation:

        public override void Configure(CommandBuffer cmd, RenderTextureDescriptor cameraTextureDescriptor)
        {
            cmd.GetTemporaryRT(bloomColourHandle.id, bloomColourDesc, FilterMode.Point);
            cmd.GetTemporaryRT(bloomDepthHandle.id, bloomDepthDesc, FilterMode.Point);
            ConfigureTarget(bloomColourHandle.Identifier(), bloomDepthHandle.Identifier());
            ConfigureClear(ClearFlag.All, Color.black);

        }

Execution:

  public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
        {  
            CommandBuffer cmd = CommandBufferPool.Get(drawObjectsProfilerTag);
       
            context.ExecuteCommandBuffer(cmd);
            cmd.Clear();

            var sortFlags = renderingData.cameraData.defaultOpaqueSortFlags;
            var drawSettings = CreateDrawingSettings(shaderTags, ref renderingData, sortFlags);
            drawSettings.enableDynamicBatching = true;
            drawSettings.perObjectData = PerObjectData.None;

            var filterSettings = new FilteringSettings(RenderQueueRange.all);
            filterSettings.layerMask = mask;

            RenderStateBlock stateBlock = new RenderStateBlock();
            stateBlock.depthState = new DepthState(true, CompareFunction.Less);

            context.DrawRenderers(renderingData.cullResults, ref drawSettings, ref filterSettings, ref stateBlock);

            // renderDepth
            cmd.SetGlobalTexture("_BloomDepth_Texture", bloomDepthHandle.id);
          }

I do make sure I set the format correctly for each hand (kDepthBufferBits = 32)
6602140--750889--upload_2020-12-9_8-54-19.png

Right now my _BloomDepth_Texture renders nothing, when I want it to render the depth of the DrawRenderers pass.

Any assistance would be very much appreciated!

Solved (for opaques at least)

// renderDepth
cmd.CopyTexture(renderer.cameraDepth, bloomDepthHandle.id);
cmd.SetGlobalTexture(“_BloomDepth_Texture”, bloomDepthHandle.id);

I needed to make a copy of the depth texture after drawing the renderers in order to set a global texture.

Now i need to solve for Transparency!