Disable write to DepthPass if Cast/Recieve Shadows is off

Hi, I have a shader that has a ShadowCaster pass, but I would like to skip this whole pass if the Lighting Settings on the mesh is set to off (Cast Shadows / Recieve Shadows), since I can see in the Frame Debug I’m getting a lot of “empty” batches in the DepthPass.Job of meshes that don’t write any information to is, but still appears. Is this the correct way to go about it? What are your suggestions?

Thanks in advance,
Lars

I’ve got around it by moving all my opaque materials to render queue 2501, but I’m not completly sure about the implication of this, however it looks fine on PC