Writing into shadowmap depth

Hello. I need write into shadowmap depth buffer of light source (for example spot light) before than shadowmap will be rendered. How I can do this? So I think I can blit one depth texture (custom render texture) with light shadowmap. But I don’t know how I can blit depth buffers of these textures.

I found solution. Just use output with SV_Depth and SV_Target in shader and enable ZWrite.

1 Like