Yep. No doubt, one way or another SampleCmp is better than Gather plus two vector instructions. Might be even more significant on mobile, but I’m not familiar with mobile shading.
Slope scaled bias would have eliminated the need for that soft comparison thingy, which does not seem to do the job it was intended to do, apart from transitions.
Speaking of soft comparison, the way it works now, it has a linear dependency curve on shadow distance. In reality, one would almost always desire to have exponential curve, that relates shadow cascade number and bias. That is another thing, why having Slope Bias and Bias controls adjustable for each cascade individually would be a one size fits all solution.
Additional thing it might be worth implementing, is ability to adjust filter size depending on the cascade, again with full manual control. This would situationally boost performance as well as eliminate another issue, that some users were complaining, namely over-blurred shadows in the distance. It would be cool, but it tags along some complications with cascade snapping and i’m unaware of reliable methods for handling cascades borders in this case. At least not with a box filter. But IMO, this topic is worth looking into.
Just found another problem that contributes this problem. When Gather4 isn’t used code is calling function. FetchRowOfThree() this always offset towards positive x coords. Calling code always use positive offsets. This Shifts shadows 1-2 texels(on both axis) depending if pcf2 or 3 is used.