I'd like to have an efficient function that would generate a wave that is close to a sawtooth but has slightly rounded peaks. The wave needs to be continuous at all points. I will be doing this in directx and opengl shaders so I have access to vector units and matrix multiplies.
EDIT: I can efficiently generate a sawtooth with the following line of code: (assuming t [0,1])
saturate(t*10.0) - t;
The problem with this is that the line isn't continuous. I'm considering sampling 4 points on the line (2 before t and 2 after) and then doing a Catmul Rom spline, but I'd be interested in any suggestions for a better way to do the smoothing.

