We present a new approach for generating cluster states on-chip, with the state encoded in the spatial component of the photonic wavefunction. We show that for spatial encoding, a change of measurement basis can improve the practicality of cluster state algorithm implementation, and demonstrate this by simulating Grover's search algorithm. Our state generation scheme involves shaping the wavefunction produced by spontaneous parametric down-conversion in on-chip waveguides using specially tailored nonlinear poling patterns. Furthermore the form of the cluster state can be reconfigured quickly by driving different waveguides in the array. Importantly, this approach allows cluster states to be generated directly from a nonlinear optical process, without requiring additional optical transformations to be applied after the initial quantum state is generated.