Networks of optical oscillators simulating coupled Ising spins have been recently proposed as a heuristic platform to solve hard optimization problems. These networks, called coherent Ising machines (CIMs), exploit the fact that the collective nonlinear dynamics of coupled oscillators can drive the system close to the global minimum of the classical Ising Hamiltonian, encoded in the coupling matrix of the network. To date, realizations of large-scale CIMs have been demonstrated using hybrid optical-electronic setups, where optical oscillators simulating different spins are subject to electronic feedback mechanisms emulating their mutual interaction. While the optical evolution ensures an ultrafast computation, the electronic coupling represents a bottleneck that causes the computational time to severely depend on the system size. Here, we propose an all-optical scalable CIM with fully programmable coupling. Our setup consists of an optical parametric amplifier with a spatial light modulator (SLM) within the parametric cavity. The spin variables are encoded in the binary phases of the optical wave front of the signal beam at different spatial points, defined by the pixels of the SLM. We first discuss how different coupling topologies can be achieved by different configurations of the SLM, and then benchmark our setup with a numerical simulation that mimics the dynamics of the proposed machine. In our proposal, both the spin dynamics and the coupling are fully performed in parallel, paving the way towards the realization of size-independent ultrafast optical hardware for large-scale computation purposes.