Cracks appear when using MipMap for variance shadow map to filter csm
Mipmaps are selected by automatically selected by computing the gradients of the texture coordinate across a 2x2 quad of pixels. Since you're doing cascade selection per-pixel, you can end up with 2 pixels within the same quad selecting different cascades. When this happens the texture coordinates will be in a different coordinate space, which will give you incorrect gradients (and thus incorrect mipmapping). To make this work you either need to guarantee that all pixels within a quad select the same cascade, or you need to calculate your gradients manually in a way that takes the cascades into account. Basically you want to compute your ddx/ddy of your position before applying the cascade matrix, then use that to reconstruct your neighboring positions. Then you can apply the selected cascade matrix to all 3 positions, and manually compute the gradients in shadow map UV space. Or altenatively if you re-arrange things so that you have 1 global shadow matrix with separate scale/offset for each cascade, you can do things more efficiently. This is the approach I used in my shadow map test framework.