I had a look at your code, and there is a thing I don’t catch:
sometimes you use a linear depth:
in DrawBasic_VSOut DrawBasic_VertexShader(DrawBasic_VSIn input)
Output.Depth = mul(input.Position, WorldView).z / -FarClip;
and sometimes not:
infloat4 DrawBasicVSM_PixelShader(DrawBasic_VSOut input) : SV_TARGET
float depth = input.Depth.x / input.Depth.y;
How can it be possible to compare the 2 values to make shadows ?