You will need to compute the frame in the depth shader too. But there will be troubles if the shader is a view material as usually...

Do sprites face the depth view? If not, I guess you will need a solution in order to drop shadows when the camera and the sun are at 90 degrees of pan.

In any case, two different depth views could work: one for static entities and other for sprites, mixed into another view stage before shadow computation. But not cheap at all.