Closed thatcosmonaut closed 3 years ago
Seems like it gets incremented here?
r1.x is (1 / PaletteWidth) and r1.y is set to 0, then gets incremented by 1 at the end of the block. So each texture2D() should be sampling at the correct spot for each iteration.
You are right... there must be some reason why the shader isn't working though...
Check it with something like LLVMpipe, if it fails there too it's probably the shader, otherwise it's probably radeonsi.
Fails on Windows D3D11 too so I must be doing something bad.
#define FLT_MAX 3.402823466e+38
This was the culprit. Don't do this.
https://gist.github.com/thatcosmonaut/ea211fddaeba4c5f7541cb583bde945e
This palette crush shader works fine with spir-v output, but it only samples the leftmost pixel on glsl output. As you can see, in the glsl output the loop never increments the texcoord.