The generalised phase contrast (GPC) method provides versatile and efficient light shaping for a range of applications. We have implemented a generalised phase contrast system that used two passes on a single spatial light modulator (SLM). Both the pupil phase distribution and the phase contrast filter were generated by the SLM. This provided extra flexibility and control over the parameters of the system including the phase step magnitude, shape, radius and position of the filter. A feedback method for the on-line optimisation of these properties was also developed. Using feedback from images of the generated light field, it was possible to dynamically adjust the phase filter parameters to provide optimum contrast.