I got this method working ( the vector array inside the MPC) but I found it to be prohibitively expensive. MPCs support up to 1024 array elements but on a 3090 I found that my GPU time was spiking into the 20-30ms range when I tried iterating more than a couple hundred. This cost scales per pixel as well, so the more of your screen that is taken up by shaders implementing this function, the worse off you are.
I think loops in shaders is generally a bad idea.