The splitIndex is determined by the distance of the pixel in the depth map, which then is used to choose what cascade to sample from and what transformation matrix to use for the cascade. No if statements needed for that, just begin with splitIndex at 0 and increase it (if necessary) through comparison statements.
I think that's what I've done in getSplitUV() ?
Except I start with index #1 because index #0 is the near depth of the first split.
(btw theses depthes are expressed in clip space)
Well the way I see it, you should always be sampling from a shadow map because as long as you transform your view-projection matrices correctly, all visible pixels will be overlapped with it.
Yes, I always sample the shadow map when possible :
factor=(g_CSMMaps.Sample(shadowMapSampler,float3(uv,split)).x+factor<posLightZ) ? 0.0f : 1.0f;
.... but it is also possible that a visible pixel is out of the shadow map, if its depth is greater than the maximal depth of the last split. In this case, the pixel is fully lighted ( color filter (1,1,1) )
My point is that sampling the color map can be avoided if shadowed, because the returned color filter is always (0,0,0)