Smoothstep essentially does what the original levelling function did but it is slightly different. It is defined as:
genType t; /* Or genDType t; */
t = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
return t * t * (3.0 - 2.0 * t);
vec4 inColour = texture(ourTexture1, TexCoord);
vec4 levelled = smoothstep(vec4(minR, minG, minB, 1), vec4(maxR, maxG, maxB, 1), inColour);
Unfortunately, I do not (currently) believe there is a way to perform this levelling accurately without knowing the minimum and maximum colour values in the image. There is also not an efficient way to find these values within the shader as the pixels "can't talk to each other".