🤔 maybe it's an artifact of using Plot.raster? My main contribution to the shader code is that I eliminated any notion of width and height—so the function itself is completely independent of the target geometry (provided you stay in the [0-65535] range for x and y).
So presuming `bayer` is working right, the problem might be the x and y values sent to it. Is Plot.raster guaranteed to always send integer values over, and increase those integer values one step per pixel?
try all you want! (use the tinker mode if you don't want to fork or to add to history.)
I've tried several things that are much faster but less nicely distributed (e.g. sqrt instead of sin). There's potential to be at least 5x faster.
I suspect that if we manage to avoid the casting between floating point and integers (for bitmasking) and inline that we'd get close to the speed of unmodified bayer