Following the tutorial in msdn:
https://docs.microsoft.com/en-us/windows/uwp/gaming/render-the-shadow-map-to-the-depth-buffer
The above link is Step 2. You can go to Step 1 if you want from the links to the left in from the above link.
Anyways, it says the following: “The output of this shader is thrown away; it can call discard on every pixel.”
But when I do discard, when I check the graphics debugger and check the shadow map resource, this happens:

But if I use
return input.pos.z / input.pos.w
in the pixel shader in the shadow render pass …