Years ago (so things might be different now) I made a PS1 bayer dither shader. At first I used an array of 16 ints for the 4x4 pattern, but then I tried recreating it from a set of booleans and modulos which looked more complicated, but ran faster (288 FPS with array, ~700 FPS with the boolean modulo mess). Here's the code if you're interested.
PixCoord = texCoord * sourceSize[0].xy - 0.5; // Turning -1,1 range to pixel range, not centered on the pixels though.
Years ago (so things might be different now) I made a PS1 bayer dither shader. At first I used an array of 16 ints for the 4x4 pattern, but then I tried recreating it from a set of booleans and modulos which looked more complicated, but ran faster (288 FPS with array, ~700 FPS with the boolean modulo mess). Here's the code if you're interested.
PixCoord = texCoord * sourceSize[0].xy - 0.5; // Turning -1,1 range to pixel range, not centered on the pixels though.
AMD's GPU ShaderAnalyzer said it was somehow less instructions and cycles, I can't explain it.